distinct_diff: avoid expression with side effects within typeid
When compiling with clang, the following warning is emitted:
abg-comparison.cc:2674:17: warning: expression with side effects will be
evaluated despite being used as an operand to 'typeid' [-Wpotentially-evaluated-expression]
return typeid(*first.get()) != typeid(*second.get());
^
Mitigate that warning by moving potential side effects out of typeid.