Intercept SIGINT and SIGTERM to close the server cleanly. The first signal request a clean exit from libevent, so it waits to complete the active events before closing. The second signal reverts to the default signal handler and quits instantly.
Fix #2294.
Pull-Request: #2323
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Ait younes Mehdi Adel <overpex@gmail.com>