Proposed fix for #194, pool timer race condition

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