fixing setting the locale back to what should be expected

Like discussed in http://code.opencv.org/issues/927 this bug was fixed for normal windows using the gtk interface. However I experienced similar problems using windows with Qt enabled.

Applied the fix suggest by Qt itself. Hopefully it builds perfectly without errors, as it works here applying that trick.

EDIT: after some consideration, I do not see why we shouldn't ensure that on every system this is double checked by setting the correct parameter using the POSIX function provided.