This syntax has never worked. in 2.5.x it will error out
2.5.x allows w=majority for standalone servers
This hits a different errorcode in 2.5.x (intentionally)
The order of fields is not guaranteed, and "sometimes" changes during writes

Fix test to work on all mongodb versions
Do another write to increase our chances of he 10 other being replicated
The request_id has been bumped by 3 at this point
Fix the weird skipif message with double reason

Stop right away when we know we aren't gonna run the test
Make it fail faster when broken, and more clearly
Fix failover tests on old mongod

When putting older 2.4 and older mongod into maintenance mode repeatidly
it will get confused as it has a task counter that will go negative and
therefore refuse to go into recovery mode, or come backup if positive
2.5.x changed some auth failure error messages and user document field order
2.5.x forces all queries on $cmd to be limit(1/-1)
Hide memory leak which we can't fix in 1.4, but is fixed in 1.5
Fixed PHP-901: Detect server state changes

The get_server_flags() is only executed upon creating the connection...
This unfortunately means that whenever the mongod changes it status -
without closing the currently open sockets - we don't detect that.
This happens for example when we force a mongod into recovery mode.

This fix extract the node type again and compares it to the original
discovery, and bails out if different.

NOTE: This is not needed in master as these functions have been merged
completely

This fixes the mongod-recovery-mode-001.phpt test in v1.4
Merge pull request #524 from bjori/PHP-901-mongod-state-change

Fixed PHP-901: Detect server state changes

* bjori/PHP-901-mongod-state-change:
  Fixed PHP-901: Detect server state changes
Merge branch 'v1.4'

* v1.4:
  Fixed PHP-901: Detect server state changes
Merge pull request #523 from bjori/fixtest-v14

Fixtest v14

* bjori/fixtest-v14:
  Hide memory leak which we can't fix in 1.4, but is fixed in 1.5
  2.5.x forces all queries on $cmd to be limit(1/-1)
  2.5.x changed some auth failure error messages and user document field order
  Fix failover tests on old mongod
  Make it fail faster when broken, and more clearly
  Fix the weird skipif message with double reason
  The request_id has been bumped by 3 at this point
  Do another write to increase our chances of he 10 other being replicated
  The order of fields is not guaranteed, and "sometimes" changes during writes
  This hits a different errorcode in 2.5.x (intentionally)
  2.5.x allows w=majority for standalone servers
  This syntax has never worked. in 2.5.x it will error out
Merge branch 'v1.4'

* v1.4:
  Hide memory leak which we can't fix in 1.4, but is fixed in 1.5
  2.5.x forces all queries on $cmd to be limit(1/-1)
  2.5.x changed some auth failure error messages and user document field order
  Fix failover tests on old mongod
  Make it fail faster when broken, and more clearly
  Fix the weird skipif message with double reason
  The request_id has been bumped by 3 at this point
  Do another write to increase our chances of he 10 other being replicated
  The order of fields is not guaranteed, and "sometimes" changes during writes
  This hits a different errorcode in 2.5.x (intentionally)
  2.5.x allows w=majority for standalone servers
  This syntax has never worked. in 2.5.x it will error out
Fixed PHP-902: Segfault when unregistering broken server

This fixes a segfault in the mongocollection-find_error-001.phpt failover test

When the server doesn't work, we need to unregister it from the manager,
otherwise we keep a dangling pointer to it, and crash when we try to
locate servers to use.

Also fix invalid read, using the wrong error variable on error