Cursor::getSingleResult() should not use keys in toArray()

This allows a document with a non-scalar identifier to be returned.
Merge pull request #150