Fix equality test for dynamic and dynamic* types.