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.

relay_write function don't return length to indicate how many bytes writen,
fix it by a new kernel patch, try to upstream this patch.