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.

Tested in `2014-07-04_04-33-53_drinkcat_chroagh_fix-proxy-env/peppy-beta_2f863267` (that is, `squawks` completed, which should be good enough).
Fix the `#PROXY#` here too?