thermal: core: Fix NULL pointer dereference in zone registration error path