Fix config tests when environment variables are set

Composer reads environment variables to overload config variables but the tests do not expect this, so the following incantation fails:

```
$ COMPOSER_CACHE_DIR=/tmp vendor/bin/phpunit --stop-on-failure

PHPUnit 3.7.37 by Sebastian Bergmann.

Configuration read from /home/chris.smith/src/composer/phpunit.xml.dist

.............................................................   61 / 1245 (  4%)
..................................F

Time: 1.99 seconds, Memory: 25.75Mb

There was 1 failure:

1) Composer\Test\ConfigTest::testVarReplacement
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'/home/chris.smith/foo'
+'/tmp'

/home/chris.smith/src/composer/tests/Composer/Test/ConfigTest.php:121

FAILURES!
Tests: 96, Assertions: 362, Failures: 1.
```

This PR actually has two resolutions implemented, see 725a4fd638c7f339cdf5f1daaff0899bdbca24d3. I think the second implementation makes more sense, I will remove the first two commits out if that's the consensus.