setup tests: fix tmpDir scoping
remove test hook from Test-AdminRights

Do not taint production code with test hooks - remove mocking ability from
regular implementation of Test-AdminRights.

For setup tests, substitute Test-AdminRights implementation in the
installation package with a stub returning a canned answer.

This slightly reduces the accuracy of setup tests, as not 100% of
production code is tested, but keeping production code pure is more
important.

As an added benefit, this is the first step in enabling the tests to be
run as a standard user.
helpers: add environment variable management abstractions

The three added functions wrap [Environment]::Get/SetEnvironmentVariable
and obtaining variable names from the registry. The purpose is to enable
mocking environment manipulation in tests.

These functions are an implementation detail and not meant to be exported
from the module. Packages should use the high-level
Install-ChocolateyEnvironmentVariable and Install-ChocolateyPath helpers.

All Chocolatey code is changed to use these functions.
tests: add environment manipulation mocking facility

Add implementations of environment manipulation functions that operate on
an object stored in a global variable, instead of on the live system
environment.

All test code that might manipulate the environment should be wrapped in a
call to Execute-WithEnvironmentProtection. This function takes a snapshot
of the environment, initializes the mocked environment state based on that
snapshot, executes test code and reverts any modifications to the
environment to the state from the snapshot.

Reverting environment changes is important for two reasons:
1) although the mocking mechanism prevents changes to the actual Machine
and User environment (by cooperating code), Process environment still
needs to be restored.
2) there is the possibility that some un-cooperating code will execute
that will, by bug or omission, bypass the environment management functions
and modify the live environment. The environment restoring code will
mitigate the damage and will emit a warning in such case, so that the
culprit may be caught.

Together with mocking admin rights tests implemented earlier, this commit
makes it possible to run Chocolatey setup tests as standard user, with no
fear of corrupting systemwide state.

Implementation note: diagnostic messages are emitted at Verbose level,
because Debug failed to appear during setup tests (no time to investigate).
use environment mocking facility in Update-SessionEnvironment tests

This simplifies and clarifies test setup code and decouples it from
implementation details, not to mention fixing the cases broken after the
helper started using the environment manipulation functions.

These tests can now be run as standard user, eliminating the fear of
corrupting systemwide environment in case of a bug.