Port ncurses 6.1 compatibility fix from termbox-go.
Port ncurses 6.1 compatibility fix from termbox-go.

Issue: https://github.com/nsf/termbox-go/issues/185

Fixes #111.

termbox/termbox,nsf/termbox,nsf/termbox,termbox/termbox,nsf/termbox,termbox/termbox