[PATCH 5.15 19/20] thermal: Fix NULL pointer dereferences in of_thermal_ functions