Implement historical change support in temporal tables.

This means that historical rows can also be updated now. A historical row is one
that has an end date. When updating such a row, all future rows are also updated,
in such a way that existing changes are preserved.
Fix bug in object_changes_between: make sure the transaction is ended and tables are unlocked before returning.