O_CLOEXEC is not available everywhere.

Use fcntl instead.