Fixed another NULL-dereference

And adding missing tests for deleteIndex/deleteIndexes so that we can see that
this failed. However, I noticed a really annoying behaviour for deleteIndex(
string ). Instead of it dropping an index with the name "string", it uses it as
a field name to append "_1" too. So you can not use it at all for user-named
indexes. I've added issue PHP-817 to the 2.x milestone to sort that out.