Log uncaught exceptions.

By default, `ThreadPoolExecutor` just ignores tasks that throw exceptions. This
change makes sure that any uncaught exception would be logged as an error.