Fix pool.getConnection race conditions