Ensure tests clean up any changes made to the environment.

This is desirable because changes to the environment can influence
the pass/fail status of other tests, which makes them dependent on
the order in which they are executed.  This matters when running
subsets of tests with --group, or when using phpunit-randomizer,
for example.