Work around for cwd stat problems with run_command and sudo

This fixes issue #6443
Make sure the cwd exists in run_command before trying to use it
git: Execute git commands in `dest` directory