handle SIGINT in the repl effectively

A while-loop with a try-except in it, surprisingly, is not particularly
good at catching rapidly repeated SIGINTs. Use a signal handler.