patch 8.2.2662: there is no way to avoid some escape sequences

Problem:    There is no way to avoid some escape sequences.
Solution:   Suppress escape sequences when the --not-a-term argument is used.
            (Gary Johnson)
diff --git a/src/os_unix.c b/src/os_unix.c
index 1c80799..20c6110 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -3343,7 +3343,7 @@
 	else
 	    out_char('\n');
     }
-    else
+    else if (!is_not_a_term())
     {
 	restore_cterm_colors();		// get original colors back
 	msg_clr_eos_force();		// clear the rest of the display
@@ -3370,9 +3370,12 @@
     {
 	settmode(TMODE_COOK);
 #ifdef FEAT_TITLE
-	// restore xterm title and icon name
-	mch_restore_title(SAVE_RESTORE_BOTH);
-	term_pop_title(SAVE_RESTORE_BOTH);
+	if (!is_not_a_term())
+	{
+	    // restore xterm title and icon name
+	    mch_restore_title(SAVE_RESTORE_BOTH);
+	    term_pop_title(SAVE_RESTORE_BOTH);
+	}
 #endif
 	/*
 	 * When t_ti is not empty but it doesn't cause swapping terminal