Catch KeyboardInterrupt for !commands on Windows

Building on #6885