Exit handler on local side.

Fixed a bug when local side just hangs when Ctrl-C is pressed.