sh: Use O_CLOEXEC and F_DUPFD_CLOEXEC instead of separate fcntl() call.