PHP-1063: Refactor cursor logic to follow MongoCommandCursor

https://jira.mongodb.org/browse/PHP-1063
Yeah, I tried that, and valgrind was still spewing double free errors. I didn't find it worth my time to spend hours looking for the cause when this simple fix works.