Fix a number of mis-uses of AVPacket in mythtranscode

Fixes some leaks, memory issues and segfaults.

We still mis-use AVPacket, but this at least lets lossless transcodes
with cut lists run to completion. Better fixes may come later when we
have more time to work on them.

Fixes #12280