avformat/nutenc: free all missing dynamic AVIOContext on header writing failure