Try to connect to xmpp only if app is hybrid or 5+ and after appcontainer config is updated.

AppContainer updates database configuration on xmpp_connect (query roster for db_managers), so we need to have the runtime available at that point.