[PATCH] thermal: sysfs: Perform bounds check when storing thermal states