Fixed PHP-773: Fix the persistence issue with logging stream contexts

Each time we instanciate MongoClient we will iterate over open servers
and apply the current stream contexts.
This will overwrite previously set contexts with the new one or reset it
to NULL if no context was provided.

If there are no open streams, we assign the context to the server
options and it will be used when creating new streams like before
Update test, we print this message out one more time when creating

multiple MongoClients since we have to find the server stream to
overwrite the stream context
server_def -> server_definition and remove a WS as per CR
Merge pull request #518 from bjori/PHP-773-context-persistance

Fixed PHP-773: Fix the persistence issue with logging stream contexts

* bjori/PHP-773-context-persistance:
  server_def -> server_definition and remove a WS as per CR
  Update test, we print this message out one more time when creating
  Fixed PHP-773: Fix the persistence issue with logging stream contexts
Merge branch 'v1.4'

* v1.4:
  server_def -> server_definition and remove a WS as per CR
  Update test, we print this message out one more time when creating
  Fixed PHP-773: Fix the persistence issue with logging stream contexts
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