ui/ncurses: Check for NULL in pmenu_item_get_index()