Add the assertion.

Add an assertion so that the program can stop at
good place.
Fix TaskBlock bug.

We should allocate TaskBlock in the heap;
otherwise the this pointer (was in InitTaskBlock)
will point to the object on the stack, which
will become invalid after the return of ScheduleTaskBlock.