(#8410) Fix child exit status on Windows
The Process.waitpid2 method in the win32-process gem returns an array,
with the child's exit status as the last element. This is different
than ruby's implementation where the last element is a Process::Status
object, which has an exitstatus method.
As a result, if a child process returned a non-zero exit status on
Windows, then Puppet::Util.execute would raise an error while trying
to call the exitstatus method on a Fixnum (the actual exit status).
This commit ensures we consistently retrieve the exit status
across all platforms.