A simple connection pool.
Uses thread-local socket per thread. By calling return_socket() a thread can return a socket to the pool.
Connect to Mongo and return a new (connected) socket.
Close and discard the active socket.
Get a socket from the pool. Returns a new socket if the pool is empty.
Return the socket currently in use to the pool. If the pool is full the socket will be discarded.