Fix nanosleep usage to not fail when broken by a signal

This is a patch that is not yet landed upstream but is up for
review here:
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20140526/106500.html

Change-Id: I2f11ca4ceb02498fc98aac5da8a07b99f0e701a3
Merge pull request #127 from awong-dev/sleep

Fix nanosleep usage to not fail when broken by a signal