Use get random bytes as uniqeid() is not unique in some cases

Fix #9161
Merge pull request #9292 from owncloud/issue/9161

Use get random bytes as uniqeid() is not unique in some cases