net: reset `endEmitted` on reconnect

fix #6908