Fix TypeError from silly use of None defaults

Repeat after me: None is not iterable. I shall not attempt to iterate
None. I shall not pass None as the default value for a missing
dictionary key unless I want a TypeError.
Don't leave files open. It's what `with` is for.
Merge pull request #10173 from narc0tiq/wtf-lang-extractor

Fix some silly Python issues with lang/extract_json_strings.py.