gh-37853: Work around inconsistent iteration in `multi_polynomial_sequence.py`
When iterating over a `pbori.BooleanPolynomial`, the iterator generates
just the monomials, whereas iterating over a `MPolynomial_libsingular`
defined over `GF(2)` yields a tuple of the monomial together with its
coefficient $1$. This causes issues in the method
`.coefficients_monomials()` of `PolynomialSequence_gf2`; we fix said
issue by checking ~~whether the iteration yields tuples, in which case
we simply replace the tuple by its second element (the actual monomial)
in each iteration.~~ which type of polynomial ring we are working in
before iterating.
Fixes #37837 (but there might be a more elegant solution).
URL: https://github.com/sagemath/sage/pull/37853
Reported by: Sebastian A. Spindler
Reviewer(s): Martin Rubey, Sebastian A. Spindler