Connection pool: Fix race conditions in limit enforcement