Cleanly handle ctrl-c