Properly handle Ctrl+C interruptions.