Test circuitpadding with zero monotonic time deltas, and fix any bugs
Any pre-ratchet monotime increment can be zero or negative, because the Windows API and gettimeofday() don't provide monotonic source times.
So after Tor applies the ratchet, any number of calls to the monotonic time functions may return the same value.
We have seen this happen when:
- Windows sleeps (see https://trac.torproject.org/projects/tor/ticket/23696#comment:13 )
- macOS has (VM?) time sync issues
We know it can also happen when:
- Tor uses gettimeofday() and a ratchet to emulate monotime, and the wall clock time goes backwards
But these circumstances are rare:
- unit tests like test_util_monotonic_time() pass on Linux, macOS, and Windows CI
- Sleeping Windows boxes don't care about padding timing accuracy
- macOS VMs are rare
- Systems without monotime functions are rare, and clock changes on those systems are also rare