miniterm: change cancel impl. for console, fixes #174

the way select was used, was incompatible with the text io
wrapper used by python3 for sys.stdin
diff --git a/serial/tools/miniterm.py b/serial/tools/miniterm.py
index 7c68e9d..14182f0 100644
--- a/serial/tools/miniterm.py
+++ b/serial/tools/miniterm.py
@@ -135,15 +135,12 @@
 elif os.name == 'posix':
     import atexit
     import termios
-    import select
+    import fcntl
 
     class Console(ConsoleBase):
         def __init__(self):
             super(Console, self).__init__()
             self.fd = sys.stdin.fileno()
-            # an additional pipe is used in getkey, so that the cancel method
-            # can abort the waiting getkey method
-            self.pipe_r, self.pipe_w = os.pipe()
             self.old = termios.tcgetattr(self.fd)
             atexit.register(self.cleanup)
             if sys.version_info < (3, 0):
@@ -159,17 +156,13 @@
             termios.tcsetattr(self.fd, termios.TCSANOW, new)
 
         def getkey(self):
-            ready, _, _ = select.select([self.enc_stdin, self.pipe_r], [], [], None)
-            if self.pipe_r in ready:
-                os.read(self.pipe_r, 1)
-                return
             c = self.enc_stdin.read(1)
             if c == unichr(0x7f):
                 c = unichr(8)    # map the BS key (which yields DEL) to backspace
             return c
 
         def cancel(self):
-            os.write(self.pipe_w, b"x")
+            fcntl.ioctl(self.fd, termios.TIOCSTI, b'\0')
 
         def cleanup(self):
             termios.tcsetattr(self.fd, termios.TCSAFLUSH, self.old)