Threads: Fix mingw-gcc warning about 'cast to pointer from integer of different size'

Use reinterpret_cast to convert from DWORD to pointer.

Change-Id: I17a12940850aeb0bc27080725a18eb93fee72ff7
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
(cherry picked from qtbase/edfdaba696d94206794203f9621d7e3aa8e5ab26)
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
QLocale: Fix infinite loop in error case

QBBSystemLocaleData emits qwarnings when it fails to open or read a pps object.
If the user code installs a message handler that will invoke QLocale API again
(i.e QDate, QDateTime, ...) then this will cause an infinite loop, where the
QBBSystemLocaleData ctor() is calling itself.

This patch logs the QBBSystemLocale's warnings to stderr and
skips the Qt message handler.

Cherry-picked: qtbase/1e446fc99167a992b1a8342168b6254f43b097fe

Change-Id: Iff99973532e0cba752854e325d0cd987765547d9
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>