Support for contention logging with ART futexes.

Remove dangerous postfix operators on AtomicInteger. Clean up the atomic stack.
Factor nanosleep into a useful shared utils.h routine.

Change-Id: I417a73007c23fe247f410f41b2fa41a717c22139
diff --git a/src/monitor.cc b/src/monitor.cc
index 6673d19..47c87cb 100644
--- a/src/monitor.cc
+++ b/src/monitor.cc
@@ -585,7 +585,6 @@
 
 void Monitor::MonitorEnter(Thread* self, Object* obj) {
   volatile int32_t* thinp = obj->GetRawLockWordAddress();
-  timespec tm;
   uint32_t sleepDelayNs;
   uint32_t minSleepDelayNs = 1000000;  /* 1 millisecond */
   uint32_t maxSleepDelayNs = 1000000000;  /* 1 second */
@@ -651,9 +650,7 @@
               sched_yield();
               sleepDelayNs = minSleepDelayNs;
             } else {
-              tm.tv_sec = 0;
-              tm.tv_nsec = sleepDelayNs;
-              nanosleep(&tm, NULL);
+              NanoSleep(sleepDelayNs);
               // Prepare the next delay value. Wrap to avoid once a second polls for eternity.
               if (sleepDelayNs < maxSleepDelayNs / 2) {
                 sleepDelayNs *= 2;