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.
> Do we have something which returns the number of outstanding operations?
> 
> We might need something like that.

No, we don't have such a thing, and I don't want to expose it. Just brute force it, it doesn't need to be the prettiest test, it needs to test that the behavior is correct. When our Jenkins machines get 128GBs of RAM we can adjust it :-)