crt: Improve support for ___lc_codepage_func() function

CRT libraries msvcrt.dll and msvcrtd.dll since their first version from
Visual C++ 4.2 provide symbol for global variable __lc_codepage.

So do not use GetProcAddress() for __lc_codepage symbol and instead
directly reference it at compile time. It means that the setlocale() hack
is not needed to compile for msvcrt.dll and msvcrtd.dll builds at all.

Split the current lc_locale_func.c source file into two files:
___lc_codepage_func.c and ___lc_codepage_func_emul.c.

Source file ___lc_codepage_func.c will use either ___lc_codepage_func() via
GetProcAddress() for msvcrt.dll builds or fallback to __lc_codepage global
variable by direct reference.

Source file ___lc_codepage_func_emul.c will use emulation via the
setlocale() hack. This is needed only for msvcrt40.dll and older CRTs.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 files changed