Fixes #8326: deletion of directories on S3