gui: Check return values of curses functions more strictly.