avformat/concat: revert one hunk of 20dfab33f5ab61fc51de65192ed239f8b62782a2

The deallocated memory contains resources that need to be freed before it
can be deallocated. The original code was correct.
This also fixes a double free

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