CVE-2026-34757: Use snapshot-before-free and defer-free patterns to prevent use-after-free when a caller passes a pointer obtained from png_get_PLTE, png_get_tRNS, png_get_hIST, png_get_text, png_get_sPLT, or png_get_unknown_chunks back into the corresponding setter (issues 836 and 837)