Minor API cleanups

Hello,

As websocket is API that may be used by other projects, it may be cleaned up to provide a better service.

1. Support SIGTERM so that front-end process can be terminated normally as well, good for systemd like service that executed in the foreground.

2. Restore signals that are being altered.

3. Avoid exiting in the middle of process.

These are minimal changes, better to have the library to allow registering termination hook, and main to handle signals, but until then, I suggest to add these minimal changes.

Thanks!