[PATCH v6 04/10] selftests/harness: Fix interleaved scheduling leading to race conditions