[xmpp-agent] save state on exit