Merge pull request #2348 from ben-clayton/thread-local

Simplify PoolAlloc by using `thread_local`