dispatcher: add function to remove listeners
dispatcher: turn keep_running into a thread-local
router: turn keep_running into a local static
collector: turn keep_running into a thread local
server: make keep_running a thread local
server: support special "internal" connections

Because we don't want to be dependant on the external listener port for
internal submission of results (collector/aggregator), pipe internal
connections directly into the dispatcher connection pool, instead of
connecting to the external listener.
server: allow multiple shutdowns

it is easier from the program point of view if the same server can be
shut down multiple times, therefore don't free the server structure, but
instead check if the thread that serves it is still alive
server: add declaration for server_add_secondaries
server: shut down secondaries before waiting for them to terminate
aggregator: make keep_running a local static
aggregator: make future error message a bit more hintful
aggregator: send out finished buckets on shutdown

In order not to lose aggregated data in completed but not yet expired
buckets, expire all completed buckets on shutdown.  This is a
best-effort action to reduce data-loss on shutdown/restart of the
aggregator.
relay: use internal connection for submission server
relay: properly remove listener iso closing the socket
relay: keep_running is no longer global

All consumers now keep their own state, so we can properly control the
order of shutdown.