avformat/mp3enc: flush buffered packets if referencing fails