Thread handle fixes

Fixes a lot of thread issues within clients, channels and libfreerdp.
What has changed:
* Threads are now properly shut down before shutdown.
* Handles to threads and events are cleared properly.
* ```ExitThread``` called at end of thread functions.
* Removed possible deadlocks in threads (Using ```WaitForMultipleObjects``` to avoid missing thread stop events)
* Added assertions.