Windows defines `timeval` with `long`, which we cannot sanely cope with. Instead, use a custom timeval struct.