Gracefully handle integer overflows.

Avoid recording negative data by doing integer-based
math as much as possible, but switch to double-based
math if we detect that we'd end up causing an overflow.

Test:
    - Builds, Boots
    - High data throughput scenarios
    - NetworkStatsHistoryTest, NetworkStatsCollectionTest,
      NetworkStatsTest.

Bug: 119527458
CRs-Fixed: 2933277
Change-Id: I355fc9bd127da83c1dc70ab3b1261346d4fa5de0
2 files changed