Fix (software) race condition in thread test

The other threads can restart thread 0 after it has stopped itself.
Only thread 0 should set the thread enable mask.