Reverse order of log statement and invoking uncaughtException handler

It doesn't do any good to attempt to log a message after we've
terminated the thread.
Merge pull request #198 from jaysoffian/fix_log_stmt

Reverse order of log statement and invoking uncaughtException handler