Make symlinks to wrapper scripts work

If you symlink to the hoq* scripts, the symlinks didn't work.  Now they
should; we need to recursively resolve symlinks before taking the directory
name.

Reported By: Thomas Braibant (@braibant)