[libc++] Refactor flaky tests for std::shared_lock (#91779)

This makes the tests non-flaky.

NOKEYCHECK=True
GitOrigin-RevId: 0012b1ea84e671a9e0c9f7f2d1564315ed9cbcca
3 files changed