Use O_CLOEXEC if it's available, instead of setting FD_CLOEXEC after open