Do not double decode values

Fixes https://github.com/owncloud/core/issues/11012
if only one attribute is requested, the returned array has 0 as key instead of attribute name. fixes #10888
Set overwritewebroot when installing owncloud to avoid problems

Backport of 249558966e6a144cf0fb873a3fac5a3664cfdd9d to stable7
Remove passing by reference to allow for proper GC

The garbage collector in PHP 5.3.10 does not properly release the file
handle when calling fclose() due to the fact that it is passed by
reference.
This has the side-effect of preventing file locks to be released as well
when the files_locking app is enabled.

This fix removes the useless passing by reference and now the file
handle and file lock are freed properly.
Use secure mimetype for content delivery

Adds some hardening against potential CSP bypassed.
Merge branch 'stable7' of https://github.com/owncloud/core into stable7