Fix labels script for missing entities
Missing/deleted items don’t have 'labels' in the response, so the script
would crash trying to process them. Use the entity ID instead, and while
we’re at it, also handle entities that exist but have no labels (which
is also possible, though not common).
(Handling of missing entities is relevant since Q22302160, which was
used e. g. in job #1, has been deleted.)