Fix traceback in git module when version checkout fails

"UnboundLocalError: local variable 'branch' referenced before assignment" is
raised in git, line 282, in switch_version.

Exception is raised when version is not branch and version checkout fails.
E.g. when version is nonexistant commit.
Tidy up fix of git module traceback
Merge branch 'git_undefined_branch_variable' of git://github.com/psvo/ansible into devel