login.py: use site.code instead of site.lang

The code used for the site is not necessary the same as the language -
this is clear for instance for commons (site.code = 'commons',
site.lang = 'en') and wikidata.

Changing this means logging in works for people using
    mysite = 'wikidata'; family = 'wikidata'

where before this resulted in a cryptic
    en.wikidata is not a valid site, please remove it from your config
error message.

Change-Id: I978437feb4862a7f1fc688fcd9ba4dee6d315c67
Merge "login.py: use site.code instead of site.lang"