Wrap PIT counter value - always
After restore_state, the pit.counter_start_time can be larger
than the current timestamp, leading to negative diff values, and
as a result, when get_counter_value is called, it can return
values larger than 16 bit integers. Thus, when ISA ports 0x40, 0x41, or
0x42 are read, the high-byte that counter_write returns can be larger
than 8-bit. Ultimately, this error is caught by the asserts in io.js. By
always applying a positive modulo to the counter value, it is always
ensured that the counter value is between zero and the reload value.