libnative/io/net, file_unix: fix offset parameters.

Also introduce new hellper functions check_error() and
check_error_unit().

Signed-off-by: NODA, Kai <nodakai@gmail.com>