call vTaskSuspend() instead of vTaskDelete()
vTaskDelete() assumes, that the stack buffer was allocated within
tasks.c. But the stack buffer is allocated form the MP heap. Freeing
it the wrong way causes memory corruption.
have all threads the same priority. Otherwise the following threads
will execute with much slower pace.
Remove usage of thread_cnt. It was only used to give threads
different priorities, which seemed to be a bad decision anyhow.
Do a hard reset with Ctrl-D if threads had been started.
That will close all tasks and free the heap.
call tls_os_time_delay(1) in the MICROPY_EVENT_POLL_HOOK macro
giving time for a task switch.