Revert incorrect patch for extension finding.
Fix getting MSYSTEM environment variable. Posix apps uses getenv instead of GetEnvironmentVariable.