libc: Switch open to use a mode_t on unix