bin/petmail: handle symlinks

This allows symlinking e.g. ~/bin/petmail -> SOURCETREE/bin/petmail, and
then running it as ~/bin/petmail . Previously the script couldn't find
its source directory through the symlink.