Catch CTRL-C for standalone, client and server modes