Use INT64_T for large file sizes.

Caused the client to return an error on success ~3GB files.
Fix errors found with -Wconversion.