Improved check for _vtkmodules_static
For static builds, this only imports _vtkmodules_static if the vtk modules aren't built-in modules (already in the executable). For shared-library builds, it will never attempt the import.
Compared to the previous code that would attempt to import vtkCommonCore and then failover to _vtkmodules_static, this will provide a more meaningful error message if an import fails.