Log and email uncaught exceptions in Python programs