Fix bug in signal handler and clean up logging code

An error of using wrong socket fd in heartbeater's signal handler
construction is fixed.  The signal handler now cleanly quit on SIGTERM.

Log levels are adjusted for each message.  Logging codes are moved to
atexit handlers if possible.
Lower normal log level from WARNING to INFO
Sync version tag 1.0.6