Build scripts: use pushd/popd everywhere