test/distributor: fix flush with worker shutdown