src/io/source_avcodec.c: keep a reference to packet to remove it when closing file