git-gui: Reorganized startup procedure to ensure gitdir is right.