Format a git_oid into a newly allocated c-string.
the c-string; NULL if memory is exhausted. Caller must deallocate the string with git__free().