esp8266/modesp: Run ets_loop_iter before/after doing flash erase/write.
esp8266/modesp: Run ets_loop_iter before/after doing flash erase/write.

A flash erase/write takes a while and during that time tasks may be
scheduled via an IRQ.  To prevent overflow of the task queue (and loss of
tasks) call ets_loop_iter() before and after slow flash operations.

Note: if a task is posted to a full queue while a flash operation is in
progress then this leads to a fault when trying to print out the error
message that the queue is full.  This patch doesn't try to fix this
particular issue, it just prevents it from happening in the first place.

MrSurly/micropython,bvernoux/micropython,pramasoul/micropython,bvernoux/micropython,pfalcon/micropython,pramasoul/micropython,MrSurly/micropython,bvernoux/micropython,MrSurly/micropython,kerneltask/micropython,selste/micropython,pfalcon/micropython,pramasoul/micropython,MrSurly/micropython,tobbad/micropython,pramasoul/micropython,henriknelson/micropython,trezor/micropython,pfalcon/micropython,swegener/micropython,pozetroninc/micropython,adafruit/circuitpython,henriknelson/micropython,tobbad/micropython,bvernoux/micropython,henriknelson/micropython,pfalcon/micropython,pfalcon/micropython,adafruit/circuitpython,selste/micropython,kerneltask/micropython,swegener/micropython,tobbad/micropython,tralamazza/micropython,tralamazza/micropython,swegener/micropython,trezor/micropython,bvernoux/micropython,pramasoul/micropython,henriknelson/micropython,adafruit/circuitpython,pozetroninc/micropython,trezor/micropython,selste/micropython,tralamazza/micropython,trezor/micropython,kerneltask/micropython,MrSurly/micropython,pozetroninc/micropython,trezor/micropython,tobbad/micropython,selste/micropython,pozetroninc/micropython,swegener/micropython,adafruit/circuitpython,adafruit/circuitpython,kerneltask/micropython,henriknelson/micropython,pozetroninc/micropython,adafruit/circuitpython,kerneltask/micropython,tralamazza/micropython,selste/micropython,swegener/micropython,tobbad/micropython