Copy length bytes from file src to file dst.

def _copy_chunk(src, dst, length):
    "Copy length bytes from file src to file dst."
    BUFSIZE = 128 * 1024
    while length > 0:
        l = min(BUFSIZE, length)
        buf = src.read(l)
        assert len(buf) == l
        dst.write(buf)
        length -= l