avcodec/ratecontrol: fix the integer overflow after long time run