Add retry logic to ElasticSearch connect helper.

fixes #4690

Working around issue with ElasticSearch connection not being
immediately reader after creating an index.