Fixes finalization error when current thread isn't fully initialized

Closes #649. During finalization `rvmHasCurrentThread()` is invoked to check if both an `Env` and a `Thread` are available. The `Env` and `Thread` are stored in TLS in `attachThread()`. The thread TLS is set after the thread has been fully initialized. The TLSs are cleared in `detachThread()`.

Tested with a plain libGDX 1.5 app which invokes CoreMotion. App used to crash after at most 2 minutes. Test run with the fix didn't crash for 15 minutes. Note that this may be an insufficient test.