stability fixes & counter optimization

reordered & modified some conditions. I'm not sure how to implement is_valid_fd on win32 (so just returned 1 to bypass).
0x7fffffff is the average nonce, so the speed should be more smooth.