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

https://github.com/owncloud/core/issues/8578#issuecomment-49812124

Partial port of https://github.com/fruux/sabre-dav/commit/52fb4a5f986466c3530af4d71e5c5a68e430efd7#diff-125bd7a16c07243283501c89f7127dfdL162.