Move `cleanup_runtime_config_instance` out of TestDaemon
Use atexit for the cleanup
Merge pull request #18500 from s0undt3ch/develop

Move `cleanup_runtime_config_instance` out of TestDaemon