Option parsing: support case-insensitive option matching.

Re-submitting r189416 with fix for Windows build on where strcasecmp is not defined.