[PATCH 5.10 029/126] thermal/core: Add NULL pointer check before using cooling device stats