Consistentify API
Emit a 'close' event
Fix double-emit 'close' event when switching from tcp -> dgram