Fix for O_CLOEXEC error on older systems