Make Barrier robust against spurious wakeups

Fix Barrier implementation so that Wait cannot return prematurely
due to a spurious condition variable wakeup or interrupted futex call.

Document the resulting semantics of barrier.h, which are a bit surprising,
but appear to be exactly what current clients need.

Fix the test so that it actually passes with the fixed barrier.h,
and no longer tests for properties that can't be correctly satisfied.

Improve comment for InitTimeSpec, which we almost used.

Bug:18509123

Change-Id: I0b25f33bcd22322ba04e3951cd484843788c2bf5
diff --git a/runtime/utils.h b/runtime/utils.h
index 668c897..f9622b7 100644
--- a/runtime/utils.h
+++ b/runtime/utils.h
@@ -430,7 +430,8 @@
 // Sleep for the given number of nanoseconds, a bad way to handle contention.
 void NanoSleep(uint64_t ns);
 
-// Initialize a timespec to either an absolute or relative time.
+// Initialize a timespec to either a relative time (ms,ns), or to the absolute
+// time corresponding to the indicated clock value plus the supplied offset.
 void InitTimeSpec(bool absolute, int clock, int64_t ms, int32_t ns, timespec* ts);
 
 // Splits a string using the given separator character into a vector of