avcodec: properly check pkt_timebase for validity