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.

Reduces the number of places outside of attribute methods which care
about the internals of how we store and type cast attributes.
See this line: https://github.com/rails/rails/pull/15564/files#diff-174733f2db65ef1bc53e3222d6ac0e61R342