MongoDB: When shutting down threads, release lock before attempting to join.
MongoDB: When shutting down threads, release lock before attempting to join.

Fixes potential deadlock when exiting.

blindsighttf2/Astron,blindsighttf2/Astron,blindsighttf2/Astron,blindsighttf2/Astron