Improved logging of exceptions in worker threads.