WINDOW_HAS_FLAGS will be defined by the configure check, but if the
platform has ncurses.h, defines the macro always. Therefore, codes
that check directly the field of WINDOW are enabled regardless of
NCURSES_OPAQUE (since ncurses 5.7), and a platform that WINDOW is
actually opaque occurs compile error at that place.
For this reason, the codes are modified to use py_is_pad macro to check
WINDOW state. Note that if ncurses doesn't have both is_pad function
(since 5.8) and _flags field of WINDOW, there is no method to check
whether WINDOW is a pad. In this case, NCURSES_OPAQUE is defined as
zero to make WINDOW to non-opaque type before including ncurses.h.