Fixed the open return value checking

For close (wrapper for systemcall) 0 is the success value.