[PATCH 6.1 0145/1146] thermal: core: fix some possible name leaks in error paths