patman: Move capture_sys_output() into terminal and rename

This function is sometimes useful outside tests. Also it can affect how
terminal output is done, e.g. whether ANSI characters should be emitted
or not.

Move it out of the test_util package and into terminal.

Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/tools/binman/image_test.py b/tools/binman/image_test.py
index 7d65e2d..26e161c 100644
--- a/tools/binman/image_test.py
+++ b/tools/binman/image_test.py
@@ -7,7 +7,7 @@
 import unittest
 
 from binman.image import Image
-from u_boot_pylib.test_util import capture_sys_output
+from u_boot_pylib import terminal
 
 class TestImage(unittest.TestCase):
     def testInvalidFormat(self):
@@ -29,7 +29,7 @@
     def testMissingSymbolOptional(self):
         image = Image('name', 'node', test=True)
         image._entries = {}
-        with capture_sys_output() as (stdout, stderr):
+        with terminal.capture() as (stdout, stderr):
             val = image.GetSymbolValue('_binman_type_prop_pname', True, 'msg', 0)
         self.assertEqual(val, None)
         self.assertEqual("Warning: msg: Entry 'type' not found in list ()\n",