Fix panic when connection is reset immediately after establishing.
ExtensiblelibraryforhandlingtheXMPPprotocol(RFC3920).Thiscodeisinspiredby,butnotderivedfrom,https://github.com/mattn/go-xmpp/.Thecoreoftheprotocolishandledbyxmpp.go,structs.go,andstream.go.Everythingelseisanextension,thoughsomeoftheprovided"extensions"aremandatorypiecesoftheprotocol.ManyoftheXEPsathttp://xmpp.org/xmpp-protocols/xmpp-extensions/ can besupportedbythislibrary,thoughatpresentonlybaseprotocolsupportishere.Ansimpleclientusingthislibraryisintheexampledirectory.Amoreinterestingexamplecanbefoundathttps://cjones.org/hg/foosfiend.ThissoftwareiswrittenbyChrisJones<chris@cjones.org>.Ifyouuseit,I'dappreciateanotelettingmeknow.Bugreportsarewelcome.ThelicenseisinLICENSE.txt;it'saBSD2-Clauselicensefromhttp://opensource.org/licenses/BSD-2-Clause.