Fixes PR59.
* src/native/jni.c (_Jv_JNI_Get##name##Field): Added TRACEJNICALLS.
(_Jv_JNI_Set##name##Field): Likewise.
(_Jv_JNI_CallStaticObjectMethod): Likewise.
(_Jv_JNI_CallStaticObjectMethodV): Likewise.
(_Jv_JNI_CallStaticObjectMethodA): Likewise.
(_Jv_JNI_CallStaticVoidMethod): Likewise.
(_Jv_JNI_CallStaticVoidMethodV): Likewise.
(_Jv_JNI_CallStaticVoidMethodA): Likewise.
(_Jv_JNI_GetArrayLength): Likewise.
(_Jv_JNI_Get##name##ArrayElements): Likewise.
(_Jv_JNI_Get##name##ArrayRegion): Likewise.
(jni_attach_current_thread): Check correctly if current thread is
already attached.
(_Jv_JNI_DetachCurrentThread): Check if current thread is already
detached.
* src/threads/posix/threads.c (threads_detach_thread): Likewise.
* src/threads/threads-common.c (threads_init) [WITH_CLASSPATH_SUN]:
Resolve correct thread init method.
(thread_create_object): New function, but not yet implemented.
(thread_create_initial_thread): Lot of changes.
* src/threads/threads-common.h (thread_is_attached): New function.
(thread_current_is_attached): Likewise.
* src/vm/global.h (STR): New macro, stolen from OpenJDK.
* src/vm/vm.c (vm_run): Detach the main thread before calling
vm_destroy.
(vm_destroy): Attach the main thread again as DestroyJavaVM thread.