fix endless loop in File::copy when sendfile is not used (solaris, bsd)