test: replcompletions: Replace timedwait by proper condvar (#58643)
Replace fragile timing-based synchronization with proper condition
variable signaling to ensure PATH cache updates complete before testing
completions. This eliminates test flakiness on systems where the cache
update takes longer than 5s.
The test failure was seen in CI:
https://buildkite.com/julialang/julia-master/builds/48273