Fix last-RHS saving in RK
The RK code currently unconditionally applies an optimization where it saves the last-stage RHS value to be reused as the first-stage RHS value of the next step. This is valid if:
- The time of the first stage is 0.
- The output-stage coefficients are equal to the last-stage coefficients.
This is true for the "high-order mode" of Bogacki-Shampine and Dormand-Prince. The code should check these conditions before applying the optimization.