[source_avcodec] prevent leak when closing swresample context