Adding in a fix for default write concern & db being null

* Server creation now has a majority write concern to avoid the error you get without it.
* db.insert now has a check for the db existing before attempting to close it