SI-8607 Fix erasure for value class inheriting from private class

The fix for SI-4283 added a pre-emptive cast of the qualifier of
a selection `qual.a` to avoid later casting to the owner of `a`
if that owner might be inaccessible at the call site. This fixed
a `LinkageError`.

In the enclosed test, this cast led to the following diff in the
tree shapes (with respect to a version with a public base class).

    [erasure]
    -        new p1.C.<init>(c.$asInstanceOf[scala.this.Int]()).a();
    +        new p1.C.<init>(new p1.C.<init>(c.$asInstanceOf[scala.this.Int]()).$asInstanceOf[ErasedValueType(    class C, scala.this.Int)]().$asInstanceOf[scala.this.Int]()).a();
    [posterasure]
    -        new p1.C.<init>(c).a();
    +        new p1.C.<init>(new p1.C.<init>(c).$asInstanceOf[scala.this.Int]().$asInstanceOf[scala.this.Int]())    .a();
             ()

What we really wanted to end up with is:

    new p1.C.<init>(c).$asInstanceOf[C]().a();

The stray cast leads to the crash:

    error: should have been unboxed by erasure: new p1.C.<init>(c).$asInstanceOf[scala.this.Int]()

Rather than trying to fix this in erasure/posterasure, this commit
instead relies on the fact the owner of `a` cannot be Java defined
if `qual`s type is a derived value class. This follows from the
restrictions we place on value classes.

With this knowledge, we elide the cast altogether in this case.
SI-8607 Generalize previous change to preErase

In the previous commit, we avoided an awkward chain of casts
by exploiting the knowledge that Scala defined classes will
by JVM accessible, and as such immune to `LinkageError`s when
used as the target of a cast.

This commit generalized this to the entire fix for SI-4283,
rather than just for derived value classes.
Merge pull request #3770 from retronym/ticket/8607

SI-8607 Fix erasure for value class inheriting from private class