[PATCH 4.19 20/56] thermal/core: Add NULL pointer check before using cooling device stats