If a counter_cache is defined, then using update_attributes and changing
the primary key on an association will make sure that the corresponding
counter on the association is changed properly. Fixes #9722.