task_init() now waits for the task switching so the stack gets set up correctly