util/os_file: dont assign cloexec when previously assigned

The EGL_MESA_platform_gbm example code placed inside the EGL reg
can crash in nouveau as gbm_create_device is passed with a fd
that already has FD_CLOEXEC and nouveau attempts to add FD_CLOEXEC
to everything passed to it which just leads to nouveau using a bad
fd. Check to make sure cloexec is not assigned before assiging it
when duplicating fds with the flag.

Signed-off-by: Yusuf Khan <yusisamerican@gmail.com>
256 jobs for !19011 with nouveau/dupfd_fix in 7 seconds (queued for 14 seconds)
latest merge request