Fix a bug where it would sleep for a full second instead of a millisecond on non-Windows.