Implement image_copyout_region(): This is the one function that is
responsible for writing to the output file. For eack chunk that
covers all or parts of the region to write, call a corresponding
function that knows how to write a chunk of that type:
image_copyout_memory(): Use write(2) to write the buffer.
image_copyout_zeroes(): Try and seek forward to create a sparse
file. If that fails, scribble zeroes to the output file to
support writing to stdout. Use image_copyout_memoryIO for
that.
image_copyout_file(): Iteratively map bits of the input file and
use image_copyout_memory() to write the bits to the output
file.
With this commit all unit tests pass again.