PHP-1231: PHP crashed when using selectCollection inside a Generator

https://jira.mongodb.org/browse/PHP-1231
I fixed that now by checking for EG(exception)