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/esp_mphal.h b/esp8266/esp_mphal.h
index fa52ae5..7a71c0f 100644
--- a/esp8266/esp_mphal.h
+++ b/esp8266/esp_mphal.h
@@ -28,10 +28,10 @@
 #define _INCLUDED_MPHAL_H_
 
 #include "py/ringbuf.h"
+#include "lib/utils/interrupt_char.h"
 #include "xtirq.h"
 
 void mp_keyboard_interrupt(void);
-extern int interrupt_char;
 
 struct _mp_print_t;
 // Structure for UART-only output via mp_printf()