[PATCH 6.8 050/336] thermal/debugfs: Prevent use-after-free from occurring after cdev removal