make sure default-directory is correct

This is needed to properly open links in newer magit versions.