[PATCH 6.1 137/313] thermal: core: call put_device() only after device_register() fails