Proposed fix for #194, pool timer race condition

Proposed fix for the timer race condition in the connection pool, #194. Also adds lock statements when clearing queues, since queue locks are taken in all other circumstances.