Call git_threads_init()
Walker: avoid an extra oid copy

Look up the commit from the repository via the 'git_oid *' which we
already have, instead of creating an extra Oid object and copying the
data.
Avoid casting

ffi.cast() takes up a surprising amount of time. We can define the
functions to take in git_object* instead.