Safe delete  of output file