Fix tests sensitive to the global configuration.

These tests were inadvertently failing due to non-trivial ~/.gitconfig
settings which are not controlled by the test suite. Use a fake home
so that the walled garden is preserved.