Fixed destruction of JVM

You don't handle if `AttachCurrentThread()` fails.