Check headers for default variant when initializing default user options.
Currently, if a user with Accept-Language: zh-tw header accesses a zh site,
the page contents are served in zh-tw variant, but the interface language
is zh (falling back to zh-hans) so the user is seeing interface messages
in zh(-hans) unless a &variant= is manually set (originally variant set in
URL is checked by getDefaultVariant).
There were debates that serving different languages based on headers from
the same URL breaks cache, but currently contents are served in different
variants based on headers and it works. So I assume this is not an issue.
PS2-4: HTTP header settings shouldn't affect user preference settings of
logged-in users.
PS5-6: Move code loading variant settings for anonymous requests from
User::getDefaultOptions() to User::loadOptions() to avoid pollution of
defaults. A visual bug of this is that if I have variant set to zh and
load index.php?title=Special:Preferences&variant=zh-cn, the dropdown is
shown as zh-cn because I was using the default value and now it thinks the
default value is zh-cn instead of zh.
PS7-8: Rebase to add dependency and tweak commit summary etc.
PS9: Remove the argument added to getDefaultVariant, which was intended to
keep B/C of getDefaultVariant (not to check headers by default).
Change-Id: Ie600ab24294a1add804875e921c32febe6ed645f