Fixed incorrect use of O_CLOEXEC.