win: roll a custom environment variable sorter, and drop invalid environment variables