Prevent deadlock calling transformation functions in ClassLoad callback.

If an agent called RetransformClasses or RedefineClasses from the
ClassLoad event callback and the class that caused the event is
included the thread would deadlock. This happened because the
verification code would try to wait for the class to be linked but
since the current thread is responsible for doing that this will never
happen. To prevent this from happening we make those functions simply
return JVMTI_ERROR_INTERNAL if they are called on the same thread the
class is being loaded on.

In order to test this we needed to modify the test helper code to keep
track of the current jvmtiEventCallbacks state.

Bug: 77652488
Test: ./test.py --host -j50

Change-Id: I0a196b999a08ec3bf9cdf98357e223f89fdcd666
21 files changed