1) Fixed unneeded calls to display from aboutToRelease(). All what we
want is to "null" "ui" field if we are in UI thread. For that we don't
need to check isUI() and Display because "ui" reference should be either
UI thread (which can be compared directly with current thread) or it is
null and we don't care.
2) Fixed race condition in isUI(), which assumes the display is not
disposed after the display.isDisposed() check. But since we are not
guaranteed to be in UI thread, someone could have disposed Display in
the meantime. So just call Thread.currentThread() that already does this
check for us.
See https://github.com/eclipse-platform/eclipse.platform.ui/issues/56