(bug 50729, bug 51699) handle exception in the langlinkhander

- there are legitimate reasons for the sites table to be empty
or missing the site id!
- in such situations, no wikibase lang links can be found and none
added, with warning

Change-Id: Icb5350f9bd75a522847f82f1215ff5bffcfea4d6