Close open file handles in files library

ref #10392
Merge pull request #10395 from owncloud/close-filehandle-lib-files

Close open file handles in files library