Account for relative jsdoc symlinks.

This happens when you install jsdoc via homebrew on Mac OS X. The jsdoc binary is actually a link to "../Cellar/jsdoc3/3.2.0/bin/jsdoc", which without this patch the BASEPATH line below tries to cd up a level from the current working directory and into a non-existent Cellar directory.

To reproduce, run `brew install jsdoc` followed by `jsdoc --help`. You'll get an error message like this:

```
$ jsdoc --help
/usr/local/bin/jsdoc: line 7: cd: ../Cellar/jsdoc3/3.2.0/bin: No such file or directory
Error: Could not find or load main class org.mozilla.javascript.tools.shell.Main
```