hw/hal: Return SYS_E[...] errors from flash API
hw/hal: Return SYS_E[...] errors from flash API

Prior to this commit: the hal_flash functions mostly returned -1 on
error.

After commit: these functions return the following error codes:
    0 on success
    SYS_EINVAL on bad argument error
    SYS_EACCES if flash region is write protected
    SYS_EIO on flash driver error

This is useful for applications that need to identify hardware failures.
This change allows hardware errors to be distinguished from
out-of-memory and bad-arguments.

mlaz/mynewt-core,mlaz/mynewt-core,mlaz/mynewt-core,mlaz/mynewt-core,mlaz/mynewt-core