Fix real_stack_size to inspect target thread instead of current thread