Index#write_tree won't remove directories

Working on [Silo](http://koraktor.de/silo) I stumbled upon `Grit::Index#write_tree` not removing directories when paths are not suffixed with a slash. Additionally `Grit::Index#add` will always strip a trailing slash due to `split('/')`. So you won't be able to delete a directory at all using `Grit::Index#delete`.

I think this is generally undesired as you're otherwise not required to suffix directory or tree paths with a slash.

I added two patches adding a test for that issue and also fixing the problem in `Index#write_tree`.