unix: guarantee write queue cb execution order in streams

The problem is that currently the canceled write callbacks
are being called before the already written callbacks, even
though they were queued after them.
On 07/07/2014 04:35 PM, Andrius Bentkus wrote:
> In test/test-tcp-write-queue-order.c:
> 
>> +
>> +  ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr));
>> +
>> +  ASSERT(0 == uv_tcp_init(uv_default_loop(), &client));
>> +  ASSERT(0 == uv_tcp_connect(&connect_req,
>> +                             &client,
>> +                             (struct sockaddr*) &addr,
>> +                             connect_cb));
>> +
>> +  ASSERT(1 == uv_run(uv_default_loop(), UV_RUN_ONCE));
>> +
>> +  buf = uv_buf_init(base, sizeof(base));
>> +
>> +  /* fill up the recv buffer */
>> +  while (1) {
>> +    r = uv_write(&write_request, connect_req.handle, &buf, 1, write_cb);
> 
> but client is uv_tcp_t and connect_req.handle is stream!
> 

But it looks odd. Please just cast it.