envsetup: Fix remote functions to deal with symlinks

merged CM Commit http://review.cyanogenmod.org/#/c/53961

Change-Id: Idf226d9cb79664af597eeca5f1d005eb6518eff0