Define optarg, optind, opterr, and optopt.

That's necessary on Windows, where you're not going to get them defined
by getopt(), and where the ref/def model rather than the common model is
used.