[PATCH v1] selftests/harness: Fix tests timeout and race condition