examples/attach: more robust check for a successful bind

<bind> is not necessarily the first child element of <success> (it isn't
in the XML returned from Prosody 0.8).  Therefore, to robustly check if
a bind succeeded, we must check *all* the children of <success> for a
<bind> element.
Merge pull request #19 from AGWA/master

boshclient.py example doesn't always authenticate successfully
[attach] Apply the rid/jid/sid to the connection's _proto
Merge pull request #21 from tagged/proto_attach

[attach] Apply the rid/jid/sid to the connection's _proto
Change state after unexpectedly killed WebSockets