[stable6] Fix sharing of ext storage mount points

Backport of https://github.com/owncloud/core/pull/8499 to stable6.

There were conflicts and I had to adapt the test.
Let's hope the tests all pass.

@icewind1991 @schiesbn @ser72