If a thread is short-lived during take over, it may look like a native thread at consecutive multiple take over attempts. This happens if its thread record will already be deleted. This patch adds a wait loop to yield to exiting threads.
Add assertions to the synch_with_all_threads barrier for no exiting threads at the end of the synch.
Minor re-naming of variable to make its meaning more clear.
Fixes #2694