Make EntityLookup robust against version issues.

Change-Id: Ibfb9880cc48efe536318581262d2ad74d5684bab
Merge "Make EntityLookup robust against version issues." into mw1.22-wmf6