Cherry pick fixes for xmpp subscribe/unsubscribe with deleted instances.