lib/interrupt_char: Factor out typical Ctrl+C handling from esp8266 port.

Utility functions for keyboard interrupt handling, to be reused across
(baremetal) ports.
diff --git a/esp8266/uart.c b/esp8266/uart.c
index d724331..001a9c6 100644
--- a/esp8266/uart.c
+++ b/esp8266/uart.c
@@ -39,8 +39,6 @@
 void soft_reset(void);
 void mp_keyboard_interrupt(void);
 
-int interrupt_char;
-
 /******************************************************************************
  * FunctionName : uart_config
  * Description  : Internal used function
@@ -172,7 +170,7 @@
 
         while (READ_PERI_REG(UART_STATUS(uart_no)) & (UART_RXFIFO_CNT << UART_RXFIFO_CNT_S)) {
             uint8 RcvChar = READ_PERI_REG(UART_FIFO(uart_no)) & 0xff;
-            if (RcvChar == interrupt_char) {
+            if (RcvChar == mp_interrupt_char) {
                 mp_keyboard_interrupt();
             } else {
                 ringbuf_put(&input_buf, RcvChar);