(#9636) Fix PATHEXT resolution for paths other than system32
Previously, Puppet::Util.which could only resolve executables that
were located in the first PATH directory entry, typically
c:\windows\system32.
This was introduced in 0258096c4 due to the inner loop overwriting the
'bin' variable that was used in the outer loop. And it wasn't noticed
during testing, because I was always using executables from
c:\windows\system32, e.g. cmd.exe.
This commit changes that the inner loop to use a different variable so
as to not clobber the 'bin' variable. It also updates the spec test.