Fix race condition in pool.go