mainloop: merge with win32 signals
mainloop: refactor signals to use a small helper function

That makes the signal setup code easier to read.
mainloop: refactor event registration to use a small helper function

This patch makes mainloop_init_events() to be easier to read.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
mainloop: merge with io-worker/worker separation
apphook: move res_init() to app_post_config_loaded()

Instead of pulling in more dependencies to mainloop, use apphook to
reinitialize the system resolver at every SIGHUP.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
mainloop: remove unneeded headers

With the latest mainloop refactor a great number of header inclusions
could be removed. This patch does exactly that.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>