Test for TecPlot errors in opt mode

I/O is easy to screw up at runtime, and these are cheap tests since
they're O(N_files) not O(N_dofs).
More Wconversion fixes
Wconversion fixes for PETSc

This also adds a static_assert when available to report PetscInt
mismatches at compile-time rather than runtime.