Fix RefinedType equality in the optimizer.

The broken equality caused the loss of inlineable class optimization
opportunities.