Replace fpassthru() as it can cause issues with large files on some systems (even 64bit).

Partial port of sabre-dav commit 52fb4a5f986466c3530af4d71e5c5a68e430efd7.
Merge pull request #107 from owncloud/fix-8578-stable6

Replace fpassthru() as it can cause issues with large files on some systems (even 64bit)