Merge pull request #943 from csware/only-close-open-filehandles git_repository_hashfile: Only close file handle if we have a valid one