py/runtime: Move MICROPY_PORT_INIT_FUNC near the end of mp_init().
py/runtime: Move MICROPY_PORT_INIT_FUNC near the end of mp_init().

This moves the MICROPY_PORT_INIT_FUNC hook to the end of mp_init(), just
before MP_THREAD_GIL_ENTER(), so that everything (in particular the GIL
mutex) is intialized before the hook is called.  MICROPY_PORT_DEINIT_FUNC
is also moved to be symmetric (but there is no functional change there).

If a port needs to perform initialisation earlier than
MICROPY_PORT_INIT_FUNC then it can do it before calling mp_init().

pozetroninc/micropython,henriknelson/micropython,pozetroninc/micropython,bvernoux/micropython,selste/micropython,selste/micropython,MrSurly/micropython,bvernoux/micropython,henriknelson/micropython,tobbad/micropython,adafruit/circuitpython,tobbad/micropython,tobbad/micropython,bvernoux/micropython,bvernoux/micropython,henriknelson/micropython,kerneltask/micropython,adafruit/circuitpython,henriknelson/micropython,selste/micropython,kerneltask/micropython,tobbad/micropython,henriknelson/micropython,pramasoul/micropython,MrSurly/micropython,kerneltask/micropython,MrSurly/micropython,pramasoul/micropython,selste/micropython,pozetroninc/micropython,adafruit/circuitpython,pramasoul/micropython,adafruit/circuitpython,pramasoul/micropython,kerneltask/micropython,bvernoux/micropython,adafruit/circuitpython,kerneltask/micropython,MrSurly/micropython,selste/micropython,pozetroninc/micropython,pozetroninc/micropython,MrSurly/micropython,pramasoul/micropython,adafruit/circuitpython,tobbad/micropython