kconfig: factor out ncurses check in a shell script