move p_machdata to the end of proc to avoid ABI breakage
ensure that thread and task state is allocated and initialized