[libc++] Refactor tests for std::condition_variable (#91530)

These tests have always been flaky, which led us to using ALLOW_RETRIES
on them. However, while investigating #89083 (using Github provided
macOS builders), these tests surfaced as being basically unworkably
flaky in that environment.

This patch solves that problem by refactoring the tests to make them
succeed deterministically.

NOKEYCHECK=True
GitOrigin-RevId: ac88ad3c805f0cc0ea85975d52b2037940b2d040
10 files changed