fix use-after-free on config reload