TCP client in ncurses