add test to reproduce race condition bug in getConnection
fix race condition bug: add connection to _timeouts before adding it to the connections list (revered access order)