Using png_destroy_write_struct() to clean up.