limit the wait time to avoid waking up vim for often than necessary.

1. don't wake more often than p_tt
2. don't overshoot the wait time (msec)
3. don't change wait time when we don't have any timers or any the total wait time is 0.

NOTE: this code is tricky :(