Fixed the inferred table name of a HABTM auxiliar

table inside a schema.

Fixes #14824.

This PR relies on https://github.com/rails/rails/pull/14871 being merged in to run.