SI-8234 Fix regression in override checks for sealed classes

adeffda25 changed `Symbol#isEffectivelyFinal` to help the optimizer
by inferring finality within sealed class hierarchies.

However, this change wasn't neccesarily welcome for other clients of
that method. In the enclosed test case, we see that overriding checks
in `RefChecks` regressed.

This commit moves the enhanced version into a new method and
selectively uses it in the optimizer (and the tail call optimizer).

Review by @adriaanm