Fix a race condition with the pool cache