Don't dereference NULL tdata in prof_{enter,leave}().

It is possible for the thread's tdata to be NULL late during thread
destruction, so take care not to dereference a NULL pointer in such
cases.