Avoid continous starts/stops of the counter thread

When the tracing runloop is entered and exited multiple times in rapid
succession, avoid starting many short-lived counter threads by having the
counter thread stop only "some time" after it's not needed anymore.