crt: Fix _beginthread and _beginthreadex functions for i386 pre-msvcr100 builds

Like the 32-bit x86 version of _XcptFilter function in pre-msvcr100 DLL
libraries, also _beginthread and _beginthreadex functions are affected and
do not handle SEH exceptions caused by SSE floating point exceptions
(STATUS_FLOAT_MULTIPLE_FAULTS and STATUS_FLOAT_MULTIPLE_TRAPS).

So if the SSE floating point exception occurs in a thread spawned by
_beginthread or _beginthreadex then it cause fatal process crash.

Add mingw-w64 wrappers around _beginthread and _beginthreadex functions
which register own SEH handler and forwards STATUS_FLOAT_MULTIPLE_FAULTS
and STATUS_FLOAT_MULTIPLE_TRAPS SEH exceptions into the __mingw_SEH_error_handler
function which now properly handles them.

This change fixes all SSE floating point exception tests running in
non-main threads for i386 pre-msvcr100 builds (including system os
msvcrt.dll library).

Signed-off-by: LIU Hao <lh_mouse@126.com>
19 files changed