Add yielding to scheduler loop.

We yield after num_thread failed steals in a row. This parameter can be tuned for better performance, but we stick to a sensible default just to prevent massive spinning.
4 jobs from coninuation in 37 seconds (queued for 1 second)
Status Job ID Name Coverage
  Build
passed #3564
build_cmake

00:20

 
  Test
failed #3565
run_tests

00:17

 
  Sanitizer
skipped #3567
run_address_sanitizer
skipped #3566
run_thread_sanitizer
 
Test run_tests
compilation terminated.
make[2]: *** [app/invoke_parallel/CMakeFiles/invoke_parallel.dir/main.cpp.o] Error 1
app/invoke_parallel/CMakeFiles/invoke_parallel.dir/build.make:62: recipe for target 'app/invoke_parallel/CMakeFiles/invoke_parallel.dir/main.cpp.o' failed
make[1]: *** [app/invoke_parallel/CMakeFiles/invoke_parallel.dir/all] Error 2
CMakeFiles/Makefile2:450: recipe for target 'app/invoke_parallel/CMakeFiles/invoke_parallel.dir/all' failed
make: *** [all] Error 2
Makefile:140: recipe for target 'all' failed
./ci_scripts/run_tests.sh: line 9: ./bin/tests: No such file or directory
ERROR: Job failed: exit code 1