Remove dead branch when restoring ID within a transaction

There is no way to have an instance of an Active Record model where
`has_attribute?(self.class.primary_key)` returns false. The record is
always initialized in such a way that `@raw_attributes` will have an id
key with nil for the value.
Merge pull request #15564 from sgrif/sg-remove-dead-code

Remove dead branch when restoring ID within a transaction

Conflicts:
	activerecord/lib/active_record/transactions.rb