Fix memory leak on DS restart with telemetry
This avoids an ASAN issue in the next commit. The test here is added for good-style but does not trigger ASAN.
This avoids an ASAN issue in the next commit. The test here is added for good-style but does not trigger ASAN.