Update to latest libgit2 API changes.

This fixes #381.