fix #153 - more consistent behaviour for nanosleep ret values, fix sleep