avformat/tee: Use ref instead copy in write_packet