Fix duplicate folders sometimes showing up in the Folders tree layout
Fix duplicate folders sometimes showing up in the Folders tree layout

The logic of the REST endpoint `/api/folders` was flawed and hence, its
result could contain duplicate entires of the same folders. However,
this wasn't immediately obvious because the folder tree structure had to
match multiple conditions for the problem to show up; see the linked
issue for details.

refs https://github.com/owncloud/music/issues/905

paulijar/music,paulijar/music,paulijar/music,owncloud/music,paulijar/music,owncloud/music,owncloud/music,paulijar/music,owncloud/music,owncloud/music