Added missing PYLITH_CHECK_ERROR(err).
Fix error trapping for PETSc functions.

Since PETSc is now usually built with C compiler, we can't trap errors
using PetscError(). Throw C++ exception from PYLITH_CHECK_ERROR instead.