Move the node type discovery into the first ismaster call (get_server_flags)
Fixed PHP-392 and PHP-844

This is a regression introduced in 1.3.x.
Arbiters do not contain any data and we should not be trying to login to
them.
Merged Pull Request #506

* pull-request/506:
  Fixed PHP-392 and PHP-844
  Move the node type discovery into the first ismaster call (get_server_flags)
Merge branch 'v1.4'

* v1.4:
  Fixed PHP-392 and PHP-844
  Move the node type discovery into the first ismaster call (get_server_flags)

This code is however slighlty different in current master, so this merge is --strategy=ours