Fix a race in PersistenceWindowPool related code.

This closes a race window where a thread could mistakenly acquire a closed window from the PersistenceWindowPool.
When this happened, the bug would manifest itself as an "illegal position" exception from the getOffsettedBuffer call.