cmCTest: fix integer overflow when uploading huge files

When uploading files greater 2GB with a 32 bit long the variable will
overflow, leading to a bad alloc when passed to new. Also avoid floating point
arithmetic when integer calculations will work as well.

Reported-by: Justin Borodinsky <justin.borodinsky@gmail.com>
Merge topic 'base64-casts' into next

63ee771e cmCTest: fix integer overflow when uploading huge files