Updated path resolution for symlinks

I wanted to symlink the file in vendor/bin to an other folder and `__DIR__` was resolved to this new folder.

by adding `realpath` it resolves the symlink and works again.
Merge pull request #932 from onigoetz/patch-1