Use original key value when updating models.

This is necessary in case the primary key was changed.

Fixes #2414.