Revert "Revert "Fix real_stack_size to inspect target thread instead of current thread""

This reverts commit 6bcdff146c1e0ff02ef37607b25f95e850bf9458.
Fix infinite recursion in c_return_event when thread is aborting
Remove code used for debugging that breaks tests