revparse: Prevent unnecessary odb backend calls
revparse: Simplify error handling
tests: Fix memory leaks
Merge pull request #1835 from libgit2/ntk/fix/less_backend_calls_on_revparsing

Some revparse love
Merge pull request #1836 from libgit2/ntk/fix/leaks

Fix memory leaks