Get PETSc directory from PETSC_DIR, import petsc if that fails

In sequential and openmp we imported petsc for the sole purpose of
calling get_petsc_dir(). This will only work if PETSc has been
installed from PyPI because only in this case there will be a PETSc
python module.

Instead we first attempt to read the environment variable PETSC_DIR,
failing that we attempt to import petsc to call get_petsc_dir() and
failing that we abort printing a helpful error message.