Fix a race condition, the child thread could get to the first assert before the parent carried out the assignment of the thread id to the variable.
Fix a race condition, the child thread could get to the first
assert before the parent carried out the assignment of the thread
id to the variable.

Detected by:	OSX

ssm/pkg-varnish,ssm/pkg-varnish,ssm/pkg-varnish,ssm/pkg-varnish,ssm/pkg-varnish