Allow for platforms that have optreset but not <getopt.h>.
Allow for platforms that have optreset but not <getopt.h>.

Reportedly, some versions of mingw are like that, and it seems plausible
in general that older platforms might be that way.  However, we'd
determined experimentally that just doing "extern int" conflicts with
the way Cygwin declares these variables, so explicitly exclude Cygwin.

Michael Paquier, tweaked by me to hopefully not break Cygwin

oberstet/postgres-xl,jmcatamney/gpdb,zeroae/postgres-xl,adam8157/gpdb,adam8157/gpdb,ashwinstar/gpdb,ashwinstar/gpdb,oberstet/postgres-xl,50wu/gpdb,xinzweb/gpdb,Postgres-XL/Postgres-XL,jmcatamney/gpdb,ovr/postgres-xl,Postgres-XL/Postgres-XL,zeroae/postgres-xl,techdragon/Postgres-XL,lisakowen/gpdb,lisakowen/gpdb,greenplum-db/gpdb,ashwinstar/gpdb,lisakowen/gpdb,zeroae/postgres-xl,xinzweb/gpdb,pavanvd/postgres-xl,zeroae/postgres-xl,jmcatamney/gpdb,50wu/gpdb,ashwinstar/gpdb,yazun/postgres-xl,ovr/postgres-xl,50wu/gpdb,xinzweb/gpdb,adam8157/gpdb,ovr/postgres-xl,jmcatamney/gpdb,jmcatamney/gpdb,oberstet/postgres-xl,greenplum-db/gpdb,greenplum-db/gpdb,ovr/postgres-xl,pavanvd/postgres-xl,lisakowen/gpdb,ashwinstar/gpdb,lisakowen/gpdb,50wu/gpdb,yazun/postgres-xl,greenplum-db/gpdb,adam8157/gpdb,pavanvd/postgres-xl,xinzweb/gpdb,oberstet/postgres-xl,pavanvd/postgres-xl,greenplum-db/gpdb,greenplum-db/gpdb,xinzweb/gpdb,50wu/gpdb,techdragon/Postgres-XL,50wu/gpdb,ashwinstar/gpdb,Postgres-XL/Postgres-XL,lisakowen/gpdb,xinzweb/gpdb,jmcatamney/gpdb,Postgres-XL/Postgres-XL,adam8157/gpdb,techdragon/Postgres-XL,greenplum-db/gpdb,ashwinstar/gpdb,50wu/gpdb,ovr/postgres-xl,adam8157/gpdb,Postgres-XL/Postgres-XL,xinzweb/gpdb,oberstet/postgres-xl,techdragon/Postgres-XL,jmcatamney/gpdb,yazun/postgres-xl,lisakowen/gpdb,50wu/gpdb,adam8157/gpdb,zeroae/postgres-xl,yazun/postgres-xl,pavanvd/postgres-xl,ashwinstar/gpdb,techdragon/Postgres-XL,xinzweb/gpdb,lisakowen/gpdb,yazun/postgres-xl,greenplum-db/gpdb,adam8157/gpdb,jmcatamney/gpdb