Fix URL::pathDirname()

Fixes the problem of the additional slash in URLs if installed in the root
directory. Previous revisions did not handle the root path (/) properly.