quicktex: Not all occurrences of dirname can be replaced with "${..%/*}"

In case the filename for which the dirname should be obtained is in the
current directory, e.g. "filename.ext". dirname would return ".", but
"${..%/*}" would return "filename.ext".