Only do a checkcast when we need to coerce Object to Unit: the code was
hopefully type-checked so that it'll only be necessary when the value is either
Unit.VALUE or null
Two changes here: StackValue.Constant does cast iff value is non-null (if null,
no cast between classes is really needed, as null can be an instance of
anything), and codegen for safe qualified expressions uses correct type for the
expression
#KT-4265 Fixed