Replaced readlink with canonical-path in remote-directory

readlink -f doesn't work on mac os-x. canonical-path provides the correct abstraction.