avformat/mpegts: Don't leave context in inconsistent state upon error