Implemented thread handling for WaitForMultipleObjects.
Implemented thread specific functions.
Now using thread_launcher function to properly clean up thread resources at exit.
Removed noreturn from ExitThread, does not conform to http://msdn.microsoft.com/en-us/library/windows/desktop/ms682659%28v=vs.85%29.aspx and crashes FreeRDP.
Preferring exit code from ExitThread now over thread function return.
Fixed thread handle cleanup, checking for resource cleanup now before resetting flags.
Fixed thread cleanup, now saving state of started flag, setting event and
then cleaning up the thread resources.
Removed WaitForSingleObject in reset_event, joining thread when not allowed.
Added funcion name to debug messages.
Fixed setting of started flag for threads.
pthred_exit now used correct return value argument.
Return value now also set when terminating thread.
Added additional tests for WaitForSingleObject and WaitForMultipleObjects.
Error messages now prefixed with function name.
Implemented bWaitAll for WaitForMultipleObjects.
pthread_join now only called on first wait event, later ones skip this to avoid undefined behavior.
Added joined flag.
Setting exited flag in TerminateThread now to allow setting return code.
Fixed typo
Fixed ExitThread, now running pthread_exit and setting event.
Fixed merge errors.
Fixed missing includes and typo.
Locking thread until joined now, preventing multiple joins and race conditions.
Offer to disable bulk compression when using remoteFx

This patch adds a skipCompression field in surface commands struct so that
we can disable bulk compression with remoteFx.
Ignore T.128 FlowPDU in Share Control header

According to the Microsoft RDP specification, T.128 flow control PDUs
should be ignored when reading Share Control headers.
(http://msdn.microsoft.com/en-us/library/cc240576.aspx). This patch
checks if we got a flow control PDU (length = 0x8000) and advances the
stream to ignore the PDU.
Fixed incorrect values for PDUTypeFlow.

Swapped values for PDU_TYPE_FLOW_RESPONSE and PDU_TYPE_FLOW_STOP to
match the T.128 spec.