Don't repopulate proxies if we don't trust the environment.

This should resolve the problems raised in #2018.