Fix scan queries with multiple shards.

As it turns out, elasticsearch is weird in two ways:

* The `size` parameter on scan queries refers to the number of hits to
  return *per shard*, not in total.
* If any of the shards have run out of results, the entire response
  has a 500 status code but can still contain results.
Don't log 500s from scroll queries as errors.

They can still be a warning, because there might actually be something
going wrong.
Debug log of results per page in all_documents.
Remove old warning about all_documents memory use.
Make sure `with_error_log_level` resets properly.
Check population has worked before switching.
Merge pull request #74 from alphagov/scan-queries-sharding-rebased

Fix scan queries with multiple shards