afsocket: Require libsystemd-daemon for socket activation

Instead of carrying a convenience copy of sd-daemon.c and sd-daemon.h,
require libsystemd-daemon for socket activation. If the library is not
found, systemd support will be disabled.

This is so other parts of syslog-ng can easily use systemd things
aswell, without having to move sd-daemon.* to lib/ or some similar
place.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
system-source: Use libsystemd-daemon functions

Instead of reimplementing various checks, use the functionality
provided by libsystemd-daemon to do the same things better.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
mainloop: Add support for systemd notifications

When compiling with systemd support, notify systemd about our status
and readiness via sd_notify().

Also set the service type to Type=notify in the systemd unit file.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>