Refactor exception codes.
Fixed PHP-755/PHP-756: Support CursorNotFound/QueryFailure query flags
Added constants for the OP_REPLY flags.
ZTS fixes.
Make a mask for error flags and provide a check end error code for a default error case.
Fixed return values in case errors were handled.