Speculative fix for std stream destruction order on Windows.
Speculative fix for std stream destruction order on Windows.

The MSVC CRT uses TLS storage to implement per-thread locales.
This storage gets freed during program termination, and if we attempt
to do any io operations (like flushing the std streams) after this occurs
the program may abort.

This patch is a speculative fix for that issue.

The fix tries forcing the initialization of the locale TLS before
initializing the std streams. This should mean that the TLS is freed
after we destroy the streams.

git-svn-id: 756ef344af921d95d562d9e9f9389127a89a6314@361348 91177308-0d34-0410-b5e6-96231b3b80d8

llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx