Fix update_all(), delete_all() with default_scope with joins().where(condition_on_joined_table)

This pull request is the same as the last one (#8449) except that it fixes use of `default_scope` with delete_all as well (since someone has made delete_all work with joins in master).

And of course it targets master instead of 3-2-stable.