gh-36882: fixing one bug in the use of valuation
Trying to divide by an integer was failing here:
```
sage: L=PowerSeriesRing(QQ,'t')
sage: t=L.gen()
sage: F=algebras.Free(L,['A','B','C'])
sage: A,B,C=F.gens()
sage: f=t*A+t**2*B/2 # BUG HERE
```
and the same for Lazy power series.
### :memo: Checklist
- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [x] I have created tests covering the changes.
URL: https://github.com/sagemath/sage/pull/36882
Reported by: Frédéric Chapoton
Reviewer(s): Travis Scrimshaw