Add TreeBuilder.get and remove TreeEntry.to_object

Also, check errors from git_tree_entry_dup