Clean shutdown on Ctrl-C