Pass O_CLOEXEC to open() or mkostemp() instead of setting FD_CLOEXEC afterwards

ok miod@
When fopen()ing internal to libc (the API doesn't support the use
of the resulting FILE *), then pass fopen() the 'e' mode letter to
mark it close-on-exec.

ok miod@
We missed a hyphen in 'async-signal-safe'

Noted by Jean-Philippe Ouellet (jean-philippe (at) ouellet.biz)