Fixed path normalization to prevent dot dirs

Fixes #5945 where stat(.) would cause the backend OC to cache a dot dir
(only in older versions)