thermal/core: Add NULL pointer check before using cooling device stats