Check the return value after an open syscall