ICANON is off is implementation-defined. Under BSD, IEXTEN is
independent of ICANON, so it must be turned off to get "raw" mode.
This was first fixed in rev.1.4 (1995/10/21) of libncurses/lib_raw.c,
but the change was lost in the downgrade to the contrib version.
The fix here is the same as in the old rev.1.4, less style bugs. A
better fix would use cfmakeraw(3) to actually handle all of the
complications for switching to raw mode.