ncurses and signal handling