Tweak signal handling logic for server.

Trap signals and invoke signal specific handler, which in turn
can call some common functionality as needed.