Add some const correctness and remove compiler warnings from mhd/solve.hpp.