Add SIGTERM and SIGINT handlers to server and listener.