backports: Add a backport of g_closefrom(), g_fdwalk_set_cloexec()
These will be new API in GLib 2.79.2.
The only code change in the implementation, other than the _glnx
wrappers, was to use `close()` instead of `g_close (fd, NULL)` in a
context where it must be async-signal safe.
The test-case needed some more adjustments to be backwards-compatible
with GLib from the distant past.
Signed-off-by:
Simon McVittie <smcv@collabora.com>