avformat/aviobuf: fix flushing write buffers after seeking backward or forward