log: handle integer overflow in timestamps