Fix compilation with Clang and libc++ under Linux

src/plugins/platforms/xcb/qxcbsessionmanager.cpp:205:80: error: use of undeclared identifier 'ERANGE'
    while (getpwuid_r(geteuid(), &entry, buf.data(), buf.size(), &entryPtr) == ERANGE) {
src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp:173:28: error: use of undeclared identifier 'LC_CTYPE'
    char *name = setlocale(LC_CTYPE, (char *)0);

Change-Id: Ide6f3072e9158eef412973ce0a72babb41b695f0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QDateTime - Fix toTimeSpec() for invalid datetimes

Check if the datetime is valid before converting it to a different time
spec.  If it is invalid then just change the spec to keep behavior
consistent with 5.1.

Task-number: QTBUG-34020
Change-Id: I6630ec1d50f810a2178ab3222bd32af018085f81
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>