The lua exit() function ends curses already.