fix prompt()

The prompt() is useful for supervisor (user) interaction during tests.

However it had numerous problems:
- closed stdin, so second prompt() didn't work
- no editing
- no utf-8 multichar
- unflexible poll interval (poll often to stay responsive to input)
and unrelated:
- stdin was hijacked by subprocess.Popen

Firstly pass stdin=PIPE to all subprocesses to leave the tester's stdin
untouched.

Secondly use python input() to read the user entry (instead of mucking about
with the stdin fd), and import readline for history and editing features.

The old approach was put in place to allow polling DBus and processes
regularly. Instead, allow this by running input() in a separate thread while
polling regularly and slowly in the main thread.

The prompt code is now simpler, cleaner and works better.
Will be used in the upcoming 'debug' suite.

Change-Id: I580aca52cd038b59418055259d0d09e9aab49124
diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py
index d73a6a8..94c3882 100644
--- a/src/osmo_gsm_tester/suite.py
+++ b/src/osmo_gsm_tester/suite.py
@@ -286,11 +286,12 @@
                                     for k,v in sorted(msg_details.items())])))
         msg = ' '.join(msgs) or 'Hit Enter to continue'
         self.log('prompt:', msg)
+        sys.__stdout__.write('\n\n--- PROMPT ---\n')
         sys.__stdout__.write(msg)
-        sys.__stdout__.write('\n> ')
+        sys.__stdout__.write('\n')
         sys.__stdout__.flush()
-        entered = util.input_polling(self.poll)
-        self.log('prompt entered:', entered)
+        entered = util.input_polling('> ', self.poll)
+        self.log('prompt entered:', repr(entered))
         return entered
 
 loaded_suite_definitions = {}