targets/core: Set proxy variables based on previous proxy setting

On update, obtain *_proxy variables from the previously generated
environment, and export them after sanitizing the value (to make
sure we do not eval random harmful stuff).

Fixes #883.
Fix check for default variable values.
targets/core: Just source the new environment file from the installer

Simpler, should be safe enough.
Merge pull request #911 from drinkcat/fix-proxy-env

targets/core: Set proxy variables based on previous proxy setting