Fixing test regression due to residual config

- This flaky test was failing because the ConfigurationRedirection test
injects a mock config and doesn't restore it back, other tests running
after it may fail.

- Implemented a IDisposable ConfigInjection class, which restores the
old configuration when disposed.

- Updated the test to using ConfigInjection class so that config is
restored after test is complete.