Fix race condition in `delay/thread'.

There's mutual dependence between promises and their threads. This may
cause a thread to start running before its promise is fully initialized,
in which case it will be `#<undefined>', which causes errors down the road.

This was the cause of an intermittent failure in the TR test harness.