VFS: remove inconsistency for Read/Write return type and parameter type, many added checks

This is an alternative for PR #4961.
To be used in conjunction with PR #4961.

Added many checks for `Read()` and `Write()` results.
Note that currently some of `Read()` implementations may return `-1` which is not always checked as it casted to unsigned value.