revparse: Don't return a reference when asked for a git object

Fix #1722
Merge pull request #1722 from libgit2/ntk/fix/issue_1722

git_revparse_ext: should return a NULL reference  when the revparse expression doesn't lead to a reference