[IMPR] make Family.langs property more robust
[IMPR] make Family.langs property more robust

Don't include closed wikis to family files with wikimedia_sites.py.

code is used as a local variable but assigning to cls.codes
may cause side effects and cls.codes could be be overwritten.
Use a copy of cls.codes instead.

Bug: T226934
Change-Id: I97e3ad1f9214e29927b4ed4d952a65eefcb68d10

wikimedia/pywikibot-core,wikimedia/pywikibot-core,PersianWikipedia/pywikibot-core