remsim-client-shell: Terminate if STDIN has been closed

Change-Id: I39937224b06b6bb6f23c002023141882797ee6a6
diff --git a/src/client/user_shell.c b/src/client/user_shell.c
index c8f1b5f..b22ee9a 100644
--- a/src/client/user_shell.c
+++ b/src/client/user_shell.c
@@ -134,6 +134,10 @@
 	rc = read(ofd->fd, cur, msgb_tailroom(ss->rx_msg));
 	if (rc < 0)
 		return rc;
+	if (rc == 0) {
+		fprintf(stderr, "STDIN was closed, terminating");
+		exit(0);
+	}
 	msgb_put(ss->rx_msg, rc);
 
 	for (i = 0; i < rc; i++) {