Weird problem with ncurses(w)