Remove symlinks from path without using File#realdirpath

Minimal change that fixes the build in 1.8.7. I know it's no big deal but the change is trivial so I think it makes sense. If you merge it into your fork it'll be added to the pull request (I didn't want to create a new one only for this).