Generalize check for localtime_r
Generalize check for localtime_r

Use the _POSIX_THREAD_SAFE_FUNCTIONS define to decide
whether localtime_r is available, instead of guessing
by Mingw-w64 version.

This copies the logic of qdatetime.cpp in qtbase, and
should fix compilations with older Mingw-w64 versions.
It replaces ce3e8f93c.

Task-number: QTBUG-34038
Change-Id: Iee8a9aa61d2af3e069e6365c40f81007c479d147
Reviewed-by: Mark Brand <67ec240b5aa784ff7b979c597c3941b52412c21b@mabrand.nl>
Reviewed-by: Simon Hausmann <a975102812d593b3191088e3d0aeaeb6f11dbcf5@digia.com>

mgrunditz/qtdeclarative-2d,qmlc/qtdeclarative,mgrunditz/qtdeclarative-2d,matthewvogt/qtdeclarative,matthewvogt/qtdeclarative,qmlc/qtdeclarative,mgrunditz/qtdeclarative-2d,qmlc/qtdeclarative,matthewvogt/qtdeclarative,matthewvogt/qtdeclarative,mgrunditz/qtdeclarative-2d,mgrunditz/qtdeclarative-2d,matthewvogt/qtdeclarative,matthewvogt/qtdeclarative,qmlc/qtdeclarative,matthewvogt/qtdeclarative,mgrunditz/qtdeclarative-2d,qmlc/qtdeclarative,qmlc/qtdeclarative,qmlc/qtdeclarative,matthewvogt/qtdeclarative,qmlc/qtdeclarative,mgrunditz/qtdeclarative-2d