Fix argument type for isprint().

Some platforms define isprint() as a macro which must have an integer
argument instead of char.  Add explicit cast to make everyone happy.
Define feature test macros for getsubopt().

Glibc officially requires _XOPEN_SOURCE > 500 and under cygwin,
__STRICT_ANSI__ seems to inhibit the getsubopt() declaration.  This
method should be more portable.