Backport #12181

This should fix the stable7 unit tests again since the last CI update.
file size on non-(Linux/BSD/Windows)-installations

Determining the file size using the exec() method is implemented for Linux, BSD, and Windows. However, on systems matching neither platform name (like SunOS), the fall-through path will return a file size result constituting a zero size instead of an invalid null return value.
Merge pull request #12223 from owncloud/fix-unit-tests-s7

Backport #12181
Merge branch 'stable7-upstream' into stable7-rotdrop