Remove unused errmsg arg from php_mongo_get_reply()

This was not used in any calling context and was likely a remnant of legacy code. Additionally, it did not appear to be freed in the error code path for MongoCursor::hasNext().
Fix MongoResultException reference when updating document property
PHP-708: Implement WriteConcernException for GLE errors

This also adds error checking for the GLE command itself, using the same function that findAndModify() uses to inspect the command response.

If the GLE response is successful, the write operation is considered to have failed if the "err" field is a non-empty string. Previously, we sourced the message and code from the "errmsg" and "n" fields, respectively, which was incorrect.
Change mongo_cursor_throw() to require exception class entry

Rather than infer the class entry (previously Cursor or CursorTimeout) from the error code, explicitly provide it. This makes it much easier to throw WriteConcernExceptions consistently (ensuring the host prefix and property are set) without having to anticipate error codes in GLE responses.
Add missing proto to CursorException::getHost()
Add host field and getter to ResultException class

MONGO_CMD() does not reveal the connection used for the command, but we will be able to set the host if a ResultException is thrown due to GLE command failure.
Add arginfos for exception methods without parameters
Remove unnecessary exception header include
MongoCursor::next() should throw for "$err", but not "err"

php_mongo_trigger_error_on_gle() will already inspect the GLE response and throw a WriteConcernException. Additionally, this old behavior in MongoCursor::next() made it impossible to return documents with a legitimate "err" field.
Move GLE "wnote" check out of MongoCursor::next()

This check belongs in php_mongo_trigger_error_on_gle() in collection.c. Additionally, we can avoid allocating a new string in the handle_error() function in cursor.c.
Free cursor in send_message() instead of do_gle_op()

Rather than free the cursor in multiple places where do_gle_op() may return, we can free it once after the single call to do_gle_op() in send_message().
Fix memory leaks setting error documents on exceptions

If the error documents in php_mongo_trigger_error_on_command_failure() and php_mongo_trigger_error_on_gle() happen to be a return_value (thanks to MONGO_METHOD macros), memory leaks are possible. A work-around is to copy the array into a new zval before assigning it to the exception.