Add fopen and fclose into ppm_read_to_file function