PHP-475: Functional tests for read preference exceptions
Merge pull request #413
Fixed PHP-795: MongoCode segfaults when internal 'code' property is modified