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)

Please review @karlitschek @schiesbn @icewind1991 @DeepDiver1975