kernel32/tests: Fix a race that could corrupt the thread register state.