Speedup tracing

Speed up the tracing by eliminating some pthread_[get|set]specific
calls, and re-organizing the wrap_special function to optimize for the
common case.

I also take the timestamp as soon as possible in the wrapped_tracer
function to get a better idea of overhead added by the backtracing.

Signed-off-by: Jeremy C. Andrus <jeremya@cs.columbia.edu>