gsid: suggestScratchSize() respect kMinimumFreeSpaceThreshold

gsid should take kMinimumFreeSpaceThreshold into account when
calculating the suggested scratch partition size.
Also use uint64_t to store any calculated intermediate result, so we can
stay confortable from overflowing, and downcast the result to int64_t
in the end, after we clamped the value within int64_t range.

Bug: 165925766
Bug: 179980369
Test: Install DSU and verify adb remount works
Change-Id: I919c723369d7d788c5c83a19e6b87f077fb2521b
3 files changed