Implemented default fnObjectEquals function.
Implemented ArrayList_Contains.
ArrayList_IndexOf and ArrayList_LastIndexOf now use comparison function.
Merge pull request #2037 from akallabeth/array-list-compare

Implemented comparison functions for ArrayList
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.
Added wait callback registration for handle specific code in WaitForSingleObject and WaitForMultipleObjects.
Added Mutex handle debug code.
Added mutex debug cmake define.
Removed mutex specific code, now handled with callback.
Fixed RegisterHandleCloseCb functions, now storing in static list.