Revert "using popd instead of $oldpwd-workaround in update-function"

This reverts commit 5ff86fc7939e675ce50a47b691fa91e2f1b0fcdd.