rework getFileSize

I have been rewriting getFileSize with the purpose of avoiding opening the encrypted file as an encrypted stream. I will need this to avoid recursion when I rework #8390 (to make the encrypted stream seekable the unencrypted filesize is required upon opening the stream).
I used the opportunity to make the procedure more robust for a number of exotic situation, such as local streams that are non-seekable or streams that return less than 8192 bytes upon fread. That should all be covered now.
I didn't do much testing yet. It seems to work on my installation. Any feedback appreciated.
No, this doesn't handle the legacy case well. Because this way you use the cipher configured in config.php which is not necessarily "AES-128-CFB" which is used for all old files.

> The alternative would be to initialise $data as an empty string, update it if there's a header, and then run parseHeader() and getCipher() on $data (even when it is an empty string). 

Yes, this should work. Another solution would be to initialize $cipher not with Helper::getCipher() but with "AES-128-CFB".