Bind self to the class being defined when checking multiple inheritance (#18465)
Fixes #18458.
When checking base class compatibility, the class being defined is not
yet in scope. However, it should be equivalent to the class passed to
`bind_and_map_method` with free typevars, as that's exactly what we are
currently defining.