Added loop to correctly read the whole file

When using user-defined stream wrappers, PHP will return a maximum of 8192 bytes even if more was requested (see https://bugs.php.net/bug.php?id=30936)

This fix adds a loop to make sure that all the file was read.

Note: this only happens for storages that use the `Common` implementation. The `Local` storage does not use that, so only external storages are likely to be affected.

Fixes #7914 

I quickly tested with SMB and it works fine, but needs a bit more testing.

To test this, use the text editor to load and save a file that is bigger than 8 Kb:
- [x] SMB
- [ ] Test with other ext storages
- [ ] Encryption
- [ ] Quota