(#8410) Cleanup and fix Windows support in Puppet::Util.execute
The primary change in this commit is fixing the support for Windows in
Puppet::Util.execute. However, properly testing this commit required
significant refactoring (which was long overdue for this old code) for
testability.
The functionality for executing on posix and windows was extracted into
platform-specific methods, execute_posix and execute_windows. These
methods are self-contained and will both return the PID of the child
process, which the caller then waits on before reading and returning the
output of the command.