Fix Path::hasFilename(), recognise paths that look like filenames but which end in slashes as not filenames