[elasticsearch] Fix race condition
This commit fixes a race condition that exists between the shards being ready to serve requests and the execution of the workload.