Backport of S3 ext storage fixes to stable6

Backport of https://github.com/owncloud/core/pull/6153 to stable6:

@ser72 can you test this branch ?
Testing that the UI itself and mounting works should be enough, as that's what the fix covers.