SIGTERM handling and socket_path checking

Added SIGTERM handling for cleaning purposes (pid file and unix socket path) and ensures one daemon process only checking for unix domain socket existence.