Equality checking of generics was invalid

The generated code was using == (op_equals) which is not allowed by the C# compiler.

Patched to use object.Equals(obj, obj) instead.