popen_rw and ncurses