pre_flush_set and post_flush_set are almost always empty, so we can use
extend() instead of a for...in loop to add the previous elements of
self._container.
We can also skip the conversion from deque to list since pre_flush is
always appended on the right side.
On a QEMU build the time spent in flush_pre_post goes from 1.4 to 0.5
seconds.