`_precompilepkgs`: interactive progress display: fix unintended capture (#57932)
The variable `str` also exists in one of the enclosing closures. Use a
new variable, as was surely intended, instead of capturing and mutating
the `str`.
Improves the sysimage's resistance to invalidation.
(cherry picked from commit fcf492d4b39c2becde6cd5ca3bb63fcbc7a308d3)