The detection of directories in S3StorageClient was flawed as it did not
account for files with a suffix. This commit forces the use of a `/` at
the end to guarantee that the matched path is a sub-{file,directory}.
Move the local path normalization process to a stand-alone function. Fix
a bug that caused relative paths to not be properly resolved due to
missing `true` in `remove_dots`.