Check for git before querying it for a version

* pbr/packaging.py(_get_version_from_git): Wrap calls to
_run_git_command in a conditional check for _git_is_installed to
avoid an opaque error message which can occur when you have a .git
directory but no git executable.

Change-Id: I6752c93d393a941daa1e7fb949c7c3d2a75337f3
Closes-Bug: #1326682
Merge "Check for git before querying it for a version"