AA should use typeinfo.equals instead of typeinfo.compare

We only ever need to check for key equality anyway, so using
typeinfo.compare is unreliable due to bugs in typeinfo.compare, plus it
may needlessly incur an expensive operation on some types.

This fixes the second half of issue #10380.