Use name-based type checking for RLM types

Rather than pointer equality, to support having Realm statically linked
into multiple libraries which are then dynamically linked together,
which results in multiple copies of each Realm class. This is of course
not something you really want to do, but it can happen naturally for
unit test targets on iOS.

Closes #690.