Fix NanoSleep and add test

Fixed a bug where tv_nsec was't between 0 and 999,999,999.

Bug: 14450052
Change-Id: I30b29a716bfa63c6b57d589dd1102d2ca934c061
diff --git a/runtime/utils_test.cc b/runtime/utils_test.cc
index 259fe33..195de0c 100644
--- a/runtime/utils_test.cc
+++ b/runtime/utils_test.cc
@@ -515,4 +515,10 @@
   EXPECT_FALSE(IsAbsoluteUint<32>(UINT_MAX_plus1));
 }
 
+TEST_F(UtilsTest, TestSleep) {
+  auto start = NanoTime();
+  NanoSleep(MsToNs(1500));
+  EXPECT_GT(NanoTime() - start, MsToNs(1000));
+}
+
 }  // namespace art