[PATCH openEuler-22.03-LTS-SP1] stm class: Fix a double free in stm_register_device()