Ensure MongoClient.connect closes connection if an error occurred

Currently `MongoClient.connect` prevents Node from exiting if an authorization failure occurs.

It assumes that if `Db.connect` returned an error, that the database wasn’t open. But in fact, `Db.connect` can return *both* and error and a `db` object.

So, in case of an error, check for a `db` object, and if it exists, close the connection.