Fix race conditions in pool.go.