gspawn: Use fcntl() to work around systems which don’t support O_CLOEXEC

Somehow, we are still limping along with partial support for OS X
<10.7.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

GNOME/glib#1488
9 jobs for 1488-o-cloexec-again in 18 minutes and 54 seconds (queued for 25 seconds)
Status Job ID Name Coverage
  Build
passed #82453
cross-android_api21_arm64

00:01:48

passed #82454
cross-android_api28_arm64

00:01:53

passed #82455
cross-mingw64

00:03:02

passed #82480
fedora-x86_64

00:04:15

manual #82458
freebsd-11 allowed to fail manual
freebsd-11-x86_64
passed #82456
win32
msys2-mingw32

00:06:10

passed #82457
win32
vs2017-x64

00:06:14

failed #82452
fedora-x86_64

00:06:18

 
  Coverage
passed #82459
coverage

00:01:38

73.3%