Make most periodic events turn themselves off when Tor is dormant, sleeping, etc.
See #2149 (moved) and https://lists.torproject.org/pipermail/tor-dev/2018-November/013529.html for some background here.
Right now we have a bunch of periodic events -- those in ROLE_ALL and those in second_elapsed_callback() -- that are scheduled all the time. Some of them are run even when DisableNetwork is set.
We should change these events as follows: we should make "ROLE_ALL" a real always-on role, and make sure we're always in it. Then we should move (nearly?) all the events out of ROLE_ALL into new roles, including a role that means "active network participant" -- that is, actively building and using circuits on the Tor network.
We should make it so "that active network participant" will turn off after either a long time without client usage, or when the controller tells it to.
We should make sure that every periodic event that remains in ROLE_ALL has a way to turn it off, a very generous and forgiving timeout, or both.