added write method to index

According to the following issue: https://github.com/libgit2/rugged/issues/254 you have to write out your index or you end up with a "weird" commit status when manually creating a commit object.

Is that the right approach after manually crafting a commit?

Tobscher