PHP-942: Throw MongoDuplicateKeyException on duplicate key errors
11001 and 12582 are also valid duplicatekey error codes
Add the error code into the test, per pr review
Merge pull request #559 from bjori/PHP-942-duplicate-key-exception

PHP-942: Throw MongoDuplicateKeyException on duplicate key errors

* bjori/PHP-942-duplicate-key-exception:
  Add the error code into the test, per pr review
  11001 and 12582 are also valid duplicatekey error codes
  PHP-942: Throw MongoDuplicateKeyException on duplicate key errors
PHP-941: Throw MongoConnectionException on stream failures

We need to be careful to restore it after each stream call, and most
importantly before mongo_manager_log(), otherwise those log entries
could throw exception
Add test for converting a stream warning into exception
Fix build with PHP 5.2 from 2006
Skip test on 5.2, tottally different looking exception
Update to use macros for PHP 5.2 compatability
Merge pull request #558 from bjori/PHP-941-throw-mongoprotocol-on-stream-failure

PHP-941: Throw MongoConnectionException on stream failures

* bjori/PHP-941-throw-mongoprotocol-on-stream-failure:
  Update to use macros for PHP 5.2 compatability
  Skip test on 5.2, tottally different looking exception
  Fix build with PHP 5.2 from 2006
  Add test for converting a stream warning into exception
  PHP-941: Throw MongoConnectionException on stream failures
PHP-944: Support $out aggregation pipeline operator
Add a comment that the value of these is significant
Remove trailing new line and add a newline between the functions as requested
Bump to E_WARNING and add MongoLog output as per review
Merge pull request #557 from bjori/PHP-944-out-aggregate-pipe

PHP-944: Support $out aggregation pipeline operator

* bjori/PHP-944-out-aggregate-pipe:
  Bump to E_WARNING and add MongoLog output as per review
  Remove trailing new line and add a newline between the functions as requested
  Add a comment that the value of these is significant
  PHP-944: Support $out aggregation pipeline operator
PHP-868: Method to check if string is a valid ObjectId
Only seperate the zval when really required
Rewrite the test as per review