Add SIGTERM and SIGINT handlers.

This lets us gracefully terminate the process.