wait for indexer to finish index rotation before deleting orphaned

improve stability of deploy 
the rotation of the indexes takes a few seconds, the clean_index function (remove orphaned indexes) has to wait for the rotation to be finished.