fix(dsolvers/ode_solver): extract mode invariant

In case we have multiple invariants on a variable, we join the
constraints. Previously, we just take the latest one in the stack.

Closes #49.