Fix critical bug with GetSysDirectories.
Merge pull request #4168 from thedax/win32Portability

Win32: Fix critical bug with GetSysDirectories.