Expose libgit2 reference database backend for managed code refdb impls.

I'd like to write a refdb backend in managed code, so here's some bindings for that!

This was very much modeled after the odb backend work, especially since my pinvoke-fu is weak.

Please note that this depends on libgit2 PR [1464](https://github.com/libgit2/libgit2/pull/1464)  so this is definitely not ready for merge until we do some updates to the libgit2 version.