Fixed PHP-1107: User lower socket time out during connection phase.
Fixed test case, and prevent segmentation faults.

Found while looking at Travis.
Merge branch 'v1.5'
Merged pull request #717
Fixed PHP-1105: long_as_object = 0 no effect.
Added more test cases.
Merge branch 'v1.5'
Merged pull request #718
Extract php_mongo_selectdb() function from MongoClient::selectDB()
Add cursor namespace to log_query stream callback
PHP-1146: Refactor MONGO_METHOD calls in deprecated Mongo error methods

There was previously no test coverage for these deprecated methods, so basic tests were added to ensure a command is actually issued.
PHP-1145: Refactor MONGO_METHOD calls in MongoDBRef::get()
Refactor MONGO_METHOD calls in MongoClient::__get()
Refactor MONGO_METHOD calls in MongoClient::selectCollection()
Refactor MONGO_METHOD calls in MongoClient::dropDB()
Refactor MONGO_METHOD calls in MongoClient::listDBs()
Extract php_mongo_db_init() function from MongoDB constructor

This allows the MONGO_METHOD call in php_mongo_selectdb() to be refactored.
Use explicit pointer checks and namespace functions by module
Merge pull request #719
Fixed PHP-722: Random segfault