Fix wait_for_thread_sleep assignment which prevented unit tests to succeed