Fix http retries for log file upload

If the log file upload fails, the IO object is closed, and will automatically fail when it is retried with an IOError. Work around that by cloning the IO object before using it in the upload.