Fix condition_variable::wait helpers with predicate
Fix condition_variable::wait helpers with predicate

The condition_variable_any::wait_{until|for} overloads taking a
predicate incorrectly just called wait_{until|for} *without* a predicate
and just checked if the predicate was true on exit. This is incorrect,
as the very point of the with-predicate overloads is that they should:

- check if the predicate is already verified and not even wait if it is;
- automatically retry at every wakeup if the predicate is not verified
  (typically done for spurious wakeups), and quit if:
  - the predicate is verified;
  - the given timeout expired.

This commit fixes the situation: wait_for(lock, rel_time, pred) and
wait_until(lock, abs_time, pred) are simply replaced with their
definitions straight from the C++ standard (C++11, §30.5.2 ¶20 and ¶25),
that ultimately define them in terms of wait_until(lock, abs_time).

Even though at low level the implementation works with a timeout
(instead of a fixed time point limit), using wait_until even to
implement wait_for is necessary because we want our timeout to be
relative to the moment when the initial wait_for was issued, without
renewing the timeout for each wakeup.

meganz/mingw-std-threads