mainloop: factor out systemd communication into a service-management module

Some communication takes place between syslog-ng and systemd after
the former has started. We indicate when initialization at startup
finished and also some textual messages to indicate our state.

Earlier it was right in the middle of the mainloop code, now factor it
out to a separate module, perhaps this interface can be useful
for other similar implementations.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
main: move app_startup() to the main function

Instead of invoking it in main_loop_init().

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
mainloop: move signal setup code to setup_signals()

Some of the signal setup code was in main_loop_run(), move that to
setup_signals() as that function is meant to set up signals.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
mainloop: factor out stats timer to a separate module

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
mainloop: add calls to initiate config reload/termination
WIP: added a few cases to under_termination

FIXME: why are these needed?
mainloop: factor out I/O worker thread handling to a separate module
mainloop: external threads stuff
mainloop: quit callback stuff
mainloop: factor out main thread calling functions to separate module
mainloop: add win32 signal handlers
control: refactor to make place for a win32 implementation

Signed-off-by: Juhasz Viktor <jviktor@balabit.hu>
Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
control: add win32 implementation for control channel

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