base: quickfix race in thread-context allocation

Just for documentation - please do not merge.

Note, the base and base-foc variants of thread.cc are similar in most
places.

Related to #1024.