crt: crt_handler: Propagate SEH EXCEPTION_INT_OVERFLOW exception also in 64-bit binaries

Division INT_MIN/-1 is undefined behavior in C and on x86 idivl instruction
generates Divide Exception. Windows in this case raises SEH exception
EXCEPTION_INT_OVERFLOW.

For 32-bit binaries this EXCEPTION_INT_OVERFLOW is not handled by
_gnu_exception_handler() and __mingw_SEH_error_handler() at all.
Case for this exception is hidden inside #ifdef _WIN64. So exception
propagates back to Windows which shows Dr. Watson dialog (if is not
disabled) and kill the process.

For 64-bit binaries this exception in those two functions is handled,
silently ignored and then instructed Windows to restart that fault
instruction. So this logic cause an infinite loop in application without
showing any error and without propagating error back to Windows.

On Linux, this x86 Divide Exception for both 32-bit and 64-bit is
translated to SIGFPE signal for which C application can register handler.

Fix the problem of x86-64 infinite loop by handling the
EXCEPTION_INT_OVERFLOW via SIGFPE signal if is registered by application.
If is not registered then propagate exception back to Windows which could
launch Dr. Watson or kill the process.

This changes also behavior for 32-bit builds as it allows to use SIGFPE too.

Bug: https://stackoverflow.com/questions/25363379/different-results-for-idiv-instruction
Co-authored-by: LIU Hao <lh_mouse@126.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
3 files changed