build: ensure we return to working directory after building