fix count argument of replace! (#25427)
`replace!` had one stack-overflow problem reported in #25384.
Its fix #25386 made a method-overwrite, tentatively fixed in #25422.
But `replace!` also didn't handle non-Int count arguments as
expected (because there is no dispatch on keyword arguments).
This fixes the root problem and adds tests for non-Int count.