(PUP-3511) refactor Application.run for reuse

Extract a small chunk of code from Puppet::Application.run into its own
method so that it can be reused.  This code is currently duplicated in
Puppet Server; the introduction of this new `reset_environment_context`
method enables the replacement of the duplicated code in Puppet Server
with a call to this new method.
I would be happy to extract these two methods out into a new `ApplicationSupport` module.

To echo Jeremy - what would you like `reset_environment_context` to be renamed to?