Properly monitor daemon peer exit event

Unix domain socket pair of the SOCK_STREAM type is used for IPC
between the two daemon processes, and each end is monitored by
the poll() system call for the POLLHUP event.  This allows event-driven
monitoring of peer exit (i.e. disconnect), simplifying the logic
of mutual monitoring.
Move redundant code before daemon's self-forking

Signal handlers don't need to be registered by each
subprocess on its own basis.  Move this procedure before forking so that
the handlers are shared by inheriting.
Move daemon worker code into their respective functions
Sync version tag 1.0.7