closures: Use Feature Test Macro Requirements to check for mkostemp(3)

Check for _GNU_SOURCE and O_CLOEXEC (added in glibc-2.7 like mkostemp).