Save logfile in case of write error on outfile.
