Wrap `git_index_write_tree_to`

Fixes #312