Fixed a bug where the mongo doc manager could be hung.
If you attempt to insert a document with an invalid key, it will
generate an error and hang the thread.
This addresses this.