Move pk initialization logic onto `AttributeSet`

Better encapsulates its internals from `ActiveRecord::Base`.
Merge pull request #16015 from sgrif/sg-ensure-initialized

Move pk initialization logic onto `AttributeSet`

Conflicts:
	activerecord/lib/active_record/attribute_set.rb