c99: use strerror_s over strerror_r under Windows
c99: use strerror_s over strerror_r under Windows

Windows/MS has dropped strerror_r support due to it _not_ being
thread-safe. At the same time, every *nix man page claims the
opposite.

The recommendation is to use strerror_s, although when building with
mingw-w64 we link against msvcrt.dll which does not provide the symbol
under Windows XP.

The issue is resolved in mingw-w64 master branch (Rev.6559), and
stable (v3.x). Any version after mingw-w64-crt 3.1.0 should be OK
(Archlinux users need v3.1.0-3 or later).

v2: Update the commit message - Archlinux package 3.1.0-3 has the fix.
v3: Move the definition to c99_compat.h
v4: Explain what the function is (if not C99 standard).

Signed-off-by: Emil Velikov <4c996f2f093ddd0585a556460b4cc3ba555546ef@gmail.com>
Reviewed-by: Brian Paul <3cb4e1df5ec4da2c7c4af7c52cec8cf340a55a10@vmware.com>
Reviewed-by: Jose Fonseca <61b5a29db2c0650f7c8510f93eece059c1b09320@vmware.com>
Reviewed-by: Chad Versace <a557f7f75bf28dc19ac99107f5cc7cd6b3fbdb1a@linux.intel.com>

waffle-gl/waffle,evelikov/waffle,janesma/waffle,janesma/waffle,waffle-gl/waffle,waffle-gl/waffle,evelikov/waffle,maurossi/waffle,fjhenigman/waffle,chadversary/waffle,janesma/waffle,fjhenigman/waffle,evelikov/waffle,dcbaker/waffle,waffle-gl/waffle,fjhenigman/waffle,dcbaker/waffle,chadversary/waffle,maurossi/waffle,maurossi/waffle,chadversary/waffle,dcbaker/waffle