Wait for index creation in aggregation tests

Review 1361 by @mlucy