THRIFT-2893 CMake build fails with boost thread or std thread

Following changes are made to fix the build
* Add USE_..._THREAD compiler definitions correctly
* Link to boost_thread and boost_system when configured with boost thread
* Link to pthread if platform is posix and std thread is used
* Use PlatformThreadFactory in test code
THRIFT-2903 Qt4 library built with CMake does not work
THRIFT-2098 Add support for Qt5+
g++-4.6 ninja

env matrix