[minor] Emit `end` after we've set the readyState
[minor] Make sure we're listing to the right event
[minor] It should not `reconnect` when we've closed the connection.