Thread-safety for pool allocator