Don't run a query if there are no edition ids
Don't run a query if there are no edition ids

This removes queries from the log that look like:

```
SELECT "editions"."analytics_identifier", "editions"."base_path", "content_id", "editions"."description", "editions"."document_type", "locale", "editions"."public_updated_at", "editions"."schema_name", "editions"."title", "editions"."details", "editions"."id", "editions"."state", "unpublishings"."type" FROM "editions" INNER JOIN "documents" ON "documents"."id" = "editions"."document_id" LEFT OUTER JOIN unpublishings
ON unpublishings.edition_id = editions.id
AND editions.state = 'unpublished' WHERE 1=0
```

alphagov/publishing-api,alphagov/publishing-api