yanglint CHANGE check for creating output handler

The list command in interactive mode.
diff --git a/tools/lint/cmd_list.c b/tools/lint/cmd_list.c
index 39a8d69..ec7a021 100644
--- a/tools/lint/cmd_list.c
+++ b/tools/lint/cmd_list.c
@@ -77,9 +77,12 @@
         }
     }
 
-    ly_out_new_file(stdout, &out);
-    print_list(out, *ctx, format);
-    ly_out_free(out, NULL,  0);
+    if (!ly_out_new_file(stdout, &out)) {
+        print_list(out, *ctx, format);
+        ly_out_free(out, NULL,  0);
+    } else {
+        YLMSG_E("Unable to print to the standard output.\n");
+    }
 
 cleanup:
     free_cmdline(argv);