Partial fix for AWTThread.getThread()
With the #524 (closed), AWTThread.getThread()
has returned null to avoid reflective access.
Since we have code in places that uses getThread()
to check if the current thread is AWT thread, we can add fix for that.