avformat/assenc: honor ReadOrder
avformat/utils: free s->pb for image2 as it can be used with and without a file

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