target/arm: Handle overflow in calculation of next timer tick