Avoid multiple threadvar lookups when querying the current TThread. Inspired by Michael Schnell.

rtl/objpas/classes/classes.inc, TThread.GetCurrentThread:
	* instead of checking CurrentThreadVar and reading it again afterwards we read it first into Result and check this value; this way we have one read access in the normal case and one read and one write access in the worst case


git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@23706 3ad0048d-3df7-0310-abae-a5850022a9f2