Sys_Sleep: support nanosleep() and prefer it on modern POSIX systems
And some sleep related refactors.
I thought about adding pselect() for sv_checkforpacketsduringsleep but probably not much point being more precise with that since it will wake up constantly anyway.