Add error-checking and recording for qsort().

The error-checking and recording is performed using an interceptor function.
The interceptor function uses a simple implementation of quicksort, with the
following additions:
 - The thread listener holds a memory lock during the qsort().
 - The lock is released when calling the comparison function (and reacquired
   directly afterwards).
 - Access to the array is checked whenever the lock is acquired.
 - All element swaps are recorded into the trace.

Add entries to the CStdFunction format select for qsort and bsearch.

Improve documentation on TraceThreadListener.

Allow TraceThreadListener clients to access the EventWriter.

Add TraceThreadListener::incrementThreadTime(), which increments the thread's
time, writes a NewThreadTime event, and resets the process time associated with
the current instruction.