esp8266: Enable micropython.schedule() with locking in pin callback.
diff --git a/esp8266/machine_pin.c b/esp8266/machine_pin.c
index a1e94e8..9ea5197 100644
--- a/esp8266/machine_pin.c
+++ b/esp8266/machine_pin.c
@@ -100,6 +100,7 @@
 }
 
 void pin_intr_handler(uint32_t status) {
+    mp_sched_lock();
     gc_lock();
     status &= 0xffff;
     for (int p = 0; status; ++p, status >>= 1) {
@@ -111,6 +112,7 @@
         }
     }
     gc_unlock();
+    mp_sched_unlock();
 }
 
 pyb_pin_obj_t *mp_obj_get_pin_obj(mp_obj_t pin_in) {