(#22191) Add cancelled resource handler

This commit adds the ability to pass a cancelled resource handler callback
to the traverse method such that if the traversal is cancelled, then the
callback is invoked once for each resource that is ready, but not yet
evaluated.

In addition, the resource is "finished", which unblocks its dependents, so
that the callback can handle those as well.

While writing tests for this, we found a bug in the main while loop.
Previously, the loop was removing the next ready resource, and then checking
if the loop had been cancelled. But if the loop was ever cancelled, the removed
resource was effectively lost. This commit reverses the order so that we only
remove the next ready resource if we intend to evaluate it.

Paired-with: Patrick Carlisle <patrick@puppetlabs.com>
(#22191) Mark ready, but unevaluated resources, as skipped

Previously, if a transaction was cancelled while processing resources, the
report did not contain any information about the skipped resources.

This commit modifies the transaction to supply a cancelled_resource_handler
callback, which if invoked, will generate a resource status object for the
resource, and mark the status as skipped.

This commit also updates the test helper to clear the run_status global
state before each test.

Paired-with: Patrick Carlisle <patrick@puppetlabs.com>
(#22191) Always process internal catalogs

Puppet generates and applies several catalogs during a single run. There is
the main (host_config) catalog, either downloaded from the master, or locally
applied. However, there are several other internally generated catalogs used
to manage internal state, such as file permissions from defaults.rb. Basically
anytime `Puppet::Settings.use` is called.

Previously, if puppet was asked to stop, `Puppet::Application.stop!`, then it
would cancel the current transaction, as well as any future transaction. As a
result, we may intentionally cancel the main (host_config) catalog, but then
unintentionally skip the transactions that follow, e.g. writing the rrdgraph
report.

This commit modifies the transaction to only cancel the evaluation loop if we
are evaluating the main (host_config) catalog and a stop has been requested.
All other internal catalogs will always be processed.
(#22191) Rename cancelled to canceled

Prefer the current American spelling from the past 30 years.
Merge branch 'ticket/master/22191-mark_skipped_resources'

* ticket/master/22191-mark_skipped_resources:
  (#22191) Rename cancelled to canceled
  (#22191) Always process internal catalogs
  (#22191) Mark ready, but unevaluated resources, as skipped
  (#22191) Add cancelled resource handler