Chunk server: optimize client thread pending lists by keeping just the "head", and iterating the temporary lists from the end so allow to clear the temporary lists while iterating.