PHP-1063: Refactor cursor logic to follow MongoCommandCursor

https://jira.mongodb.org/browse/PHP-1063
Running this testcase after reverting the fix for 963 still causes segfault?

Segfault tests often rely on very precise execution paths so modifying such tests should be done very sparingly.
What did it fix anyway?