Fix #963

Problem: Bug was introduced because `os_open` returns `-errno` in case
of an error instead of just `-1` which was returned by `mch_open`.
Solution: Check return value with `< 0` instead of `== -1`.

Btw, most of such checks were changed by @justinmk in original PR #846.