Read https+ftp proxy environment variables into system properties.  Fixes #886.
Fix NPE in TrapExit due to improper scoping of null check.