Use a signal handler to catch SIGINT

Rather than exiting, catch SIGINT and clean up appropriately.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
1 file changed