Simplify handling of buffer chains via a list.

This will allow flushing the encoder more
than once (e.g. before forcing a keyframe).