[1.7.x] Fixed typo in error message in django.contrib.sitemaps.

Backport of d81a9c50d8 from master
[1.7.x] Fixed #22293 -- Avoided renaming many-to-many tables to themselves.

Fixed this for both implementations of _alter_many_to_many, instead of
in `alter_db_table` itself (more implementations).

Backport of 1edfa155e3 from master
Fix circular dependency being incorrectly added to the dependency graph

In the build_graph method of the MigrationLoader class the self.graph.root_nodes(...) method
was run on a dependency graph that was not yet fully constructed. This could cause the current
node (<<key>>) to be incorrectly included among the returned root nodes and since the parent is
drawn from this set one could get circular dependencies not present in the real dependency graph.
Hopefully this change will fix the problems described in Django tickets #22325 and #22277.