clone: fix -Wmaybe-uninitialized warning
revparse: Simplify temporary reference freeing
revparse: Introduce git_revparse_ext()

Expose a way to retrieve, along with the target git_object, the reference
pointed at by some revparse expression (`@{<-n>}` or
`<branchname>@{upstream}` syntax).
Fix some memory leaks