Oid: make sure not to dereference a NULL git_oid

Some calls like Reference.Target() can return NULL if the reference is
symbolic. Make sure newOidFromC() can handle these situations.

---

I couldn't decide whether we should return nil or a zeroed Oid in this case. A zeroed id won't make you segfault, but it could lead to the code assuming it has a proper id. Thoughts?