Close MongoDB connection in onApplicationStop() to release resources.