Limit the number of buffers that can be cached in a thread to the number that have been allocated