[vfs] Fix reading with zero size and null pointer
[vfs] Fix write with zero size and null pointer
[emu] Better emulate system read()/fread() functions
Merge pull request #5534 from Karlson2k/fix_vfs_and_emu_01

Better emulate system read() and fread() functions, fixes #15490