fix ktapio cannot read remain content when ktap exiting

Now ktapvm will wait ktapio thread read all remain content in relay buf,
add completion structure into global_state.

Also use a new manager thread to manage ktapio threads.