Should we do something like
````
if stream.state == OPEN
  stream.state = CLOSING
  ccall(...)
end
````
then mark it closed in the callback?