service/service_stopped(): fix a use-after-free