Fix proxy instance equality

This is a WIP patch for [#14492](https://code.djangoproject.com/ticket/14492).

It makes proxy instances equatable with model instances and other proxy instances.