Fix threading for Qt5.

Fix GL Context on Qt5.
Also fix EmuThread loop.

Working fine on Linux.