Cleanup Reference.each.

No idea what I was thinking while implementing this...
Fix a memory leak in Rugged.minimize_oid.
Fix some typos in the minimize_oid docs.
Only test for nil, not a truthy value.
Return GIT_OK instead of 0.