thermal: of: fix double-free on unregistration (CVE-2023-53997) | HOL Guard CVE