(Maint) Retry shutdown abort command

Many of the acceptance tests execute puppet to trigger a reboot, and
then verify that the reboot was initiated. The tests do so by executing
the `shutdown /a` command to abort the shutdown. It returns 0 if a
shutdown is in progress, or 1116 if a shutdown is not in progress.

Note due to ruby bug[1], the exit code 1116 is truncated to one byte,
which yields 92.

However, puppet executes the watcher process asynchronously, so it was
possible for the acceptance test to issue the abort shutdown command
before the watcher process had initiated the shutdown. The tests tried
to work around this by sleeping for 5 seconds, but this doesn't work
on slow systems in CI.

This commit adds a helper method for retrying the shutdown abort command
and updates the various acceptance tests to use it. It also adds a
helper method for the opposite case, when verifying that a shutdown has
NOT been initiated.

[1] https://bugs.ruby-lang.org/issues/8083
(Maint) Handle race when puppet has already exited

Previously, if the watcher's call to `OpenProcess` failed, we treated
that as a fatal error, since we couldn't get a handle on which to
wait for puppet to exit.

However, if puppet exits before the watcher process calls `OpenProcess`,
then the call to `OpenProcess` will fail, and the watcher would never
reboot the system.

This commit checks that if `OpenProcess` fails and `GetLastError`
returns 87 (INVALID_PARAMTER), then it means the pid no longer exists.
And we can conclude that puppet has already exited (as opposed to being
a bogus pid), because puppet passes its pid as a command line
argument to the watcher.

If `OpenProcess` fails and `GetLastError` is something other than 87,
then that is still treated as a fatal error.
(Maint) Don't write to stderr from the watcher

Previously, the watcher was writing the shutdown command to $stderr just
before executing the command. However, if the puppet process had already
exited, then the call to $stderr.puts will raise an exception when
executed via cygwin.

The exception message said: Invalid argument - <STDERR>. And since the
exception is raised just before executing the shutdown command, the
acceptance test would fail.

Note this is timing dependent, since everything works out ok if puppet
is still running when the watcher writes the shutdown command to
$stderr.

This commit adds exception handling around the watcher, and changes the
watcher to write to a temp file. Also some of the acceptance tests rely
on parsing the shutdown command that the watcher is going to execute. I
moved this into the provider itself.

One acceptance test had to be modified so that it doesn't try to match
the timeout message, since the watcher no longer writes to $stderr.