Don't use refresh='wait_for' when updating origins.
It makes origin update very slow, and was only useful for tests.
Instead, this commit adds a 'flush' endpoints that is called by
tests, because they need the indices to be refreshed to test
the results of a search query.