releasing mongo resources on shutdown