Refactor Python error handling code into separate header.

Refs #7019
Translate Python errors to C++ exception in RunPythonScript

Refs #7019