Don't leave any zombies behind (--end-after-ready)

For systemd daemons running on upstart, if they are known to only use
the notification protocol once and then forget about it,
--end-after-ready can be used to let the helper process die as early as
possible.

This commit makes sure that no zombies are left behind when using this
option. This is done by double-forking and terminating the intermediate
process.
Change upstart-daemon on top of systemd logic

Adds an additional fork level to make sure the daemon is actually a
child of init once we tell systemd what the new main pid is. This
suppresses the warning message.

Note that it is not clear that this is the optimal version, since it
completely breaks with systemd-204. systemd-208 is fine, but also was
fine with the previous version (apart from a suprious warning message).
(systemd-208 properly detects service failures in both (!) versions.)
For now, stick with the version that works with current systemd and
doesn't produce a warning message, but somebody porting this to a
systemd-204 system may want to use the older version.
Check socket type when translating

When translating from systemd socket activation to upstart socket
activation, check that the socket is of type SOCK_STREAM, fail
otherwise.