SI-6782 Avoid the "IMPLCLASS flag not set" warning in resident mode

This reverts the workaround in commit d6991229, but leaves the
test, run/t5789.scala, in place.

That test actually no longer trips the assertion. In fact, even
when the assertion was weakened to a debugwarn, just running
under `-Ydebug` to *see* the warning was enough to avoid the
condition that would issue it!

I bisected back through this history to find at which commit
the `Function0$class` symbol in the second line of that REPL
test started to have the IMPLCLASS bit set (ie, it was a real
impl class symbol, and not an `abstract java trait` dummy symbol
for the compiled impl class found in the classpath.)

That point was 6db8a52, "SI-6507 do not call .toString on REPL
results when :silent is on." I didn't dig deeper to see why
that avoided the problem.

But I did go back one commit further. I changed the `debugwarn`
back to an `assert`, and confirmed the test failed. I then
suspected the problem related to the way we unlink old
impl class symbols before installing the new one. On a hunch,
I tried extending this unlinking to operated on every entry
in the type history. Voila! The test passed again.

This commit applies that fix to 2.11.x.