Use 64 bit buffer lengths.

This is pulled out of the Confuga branch where we want to able to hash large
files. This commit also changes the <hash>_file routines to use mmap if
possible.