avcodec/internal: move packet related functions to their own header