Fix access to slots of the thread struct.

Use actual symbols to determine whether a variable is specially
handled, not their names.