[PATCH 5.4 27/74] thermal/core: Add NULL pointer check before using cooling device stats