[PHP-647] Check isMaster response for "secondary" field

Create a new connection type, INVALID, for when the connection type cannot be inferred (e.g. recovering secondary).
[PHP-647] Update tests for logging of isMaster "secondary" value
[PHP-647] Test that queries are not sent to recovering secondaries

Helper functions were ported from the Python driver's ha_tools.py module.
Merged pull request #256