Avoid 32-bit counter rollovers. Signed-off-by: Ben Kochie <superq@gmail.com>
Same as for openbsd, this is just slightly adjusted from freebsd variant.