[PATCH v3 4/9] selftests/harness: Fix interleaved scheduling leading to race conditions