Use copy_file_range(2) instead of our own inefficient and unreliable
attempt at detecting holes. If copy_file_range(2) is not available,
which in theory should be never, we fall back to a simple read(2) /
write(2) loop which makes no attempt to copy holes. This should
speed up pax copy mode and cpio passthrough mode significantly.
This includes refactoring much of the existing I/O code to use the
size_t and ssize_t instead of int where appropriate.
MFC after: 1 week
Sponsored by: Klara, Inc.