Use the pool_lock in the buffer_alloc function to detect shutdown. Avoids crashes when the sink is shutdown.