avformat: Append data in fill_buffer() when possible

Data is appended in fill_buffer() when there is sufficient space left
and the data pointer only reset when needed.
Previously the data pointer was more often reset, loosing more seekback
space than otherwise needed.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avformat/aviobuf: Add ffio_ensure_seekback()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
mpegts: use ffio_ensure_seekback()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>