[PATCH openEuler-5.10-LTS 415/427] thermal/core: fix a UAF bug in __thermal_cooling_device_register()