Made Model.__eq__ consider proxy models equivalent

This commit fixes tickets #11892, #16458 and #14492.