Fix EMSGSIZE issue on Windows