Minor type cast fixes for UBSan

* Cast to uint64_t in size math to prevent multiplication overflow
  on 32-bit platforms.
* Explicitly cast to time_t to prevent sign santization.

Bug: 129300035
Change-Id: If2f6d4aafa9f2c6e655c771d1ff9df90d2546fd4
2 files changed