[PATCH AUTOSEL 5.4 22/24] thermal/core: Add NULL pointer check before using cooling device stats