[865758] Improved error handling of MongoDB connection problems

Ref: https://bugzilla.mozilla.org/show_bug.cgi?id=865758