timer: fix race when reschedulingr (fixes #17289)
timer: fix race when reschedulingr (fixes #17289)

This fixes the overrun counter to always use the intended deadline
and interval values. Otherwise the counter value would be garbade, and
potentially cause an interger underflow. This would also potentially
corrupt the adjusted deadline and stall the timer thread.

This also fixes the disarm handling. From now on, a non-recurrent timer
is disarmed after expiration only if it has not been rescheduled or if
the new schedule is no later than the old one.

xkfz007/vlc,xkfz007/vlc,xkfz007/vlc,xkfz007/vlc,xkfz007/vlc,xkfz007/vlc,xkfz007/vlc