If we're appending when last component ISDIR, we should surely remove trailing slash if the full string names an extant file (other than a symlink to a directory).