Use a lock around all updates to shared state.

Prevent closed connections from ending up in the pool (Mutator uses "return_to_pool"). Since current_conns has already been decremented, the pool would reach a state where a new connection was always opened but could not be put in the queue since it was full.