Fix a bug that could cause nanosleep receive an invalid argument