Improved threads
added tlsptr class
upon Windows api error now more information is printed