weston: Set CLOEXEC on stdin

We don't want to leak this into apps launched from the panel.

stdout and stderr are left for now because some things launched
by weston - such as weston-keyboard - share weston's log by
printing to those fds.

I'm singling out stdin because it's never needed by a child process
and because it's value is 0, which makes it easy to accidentally
do bad things to (commit 5c611d933f60f720db98331c9c1c6ed4420f9782)

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
diff --git a/compositor/main.c b/compositor/main.c
index e870dd4..f8a60e9 100644
--- a/compositor/main.c
+++ b/compositor/main.c
@@ -1800,6 +1800,11 @@
 		{ WESTON_OPTION_STRING, "config", 'c', &config_file },
 	};
 
+	if (os_fd_set_cloexec(fileno(stdin))) {
+		printf("Unable to set stdin as close on exec().\n");
+		return EXIT_FAILURE;
+	}
+
 	cmdline = copy_command_line(argc, argv);
 	parse_options(core_options, ARRAY_LENGTH(core_options), &argc, argv);