fopen and fclose to ppm_write_to_file function
Change ppm_write_to_file arguments : add a filename argument