lavf/mp3enc: make sure the header is valid before writing audio pkt.