avformat/mux: flush after header writing, like after packets

This makes problematic unconditional flushes in mpegts redundant
And is thus part of a fix for ticket 2748

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avformat/mpegtsenc: do not flush after everything

there is flushing code in the avformat core that does this in a more
controlled way.

Fixes ticket2748

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