Fix: unload record with relationships

- calling `clearRelationships` before changing record state,
  otherwise fails because properties try to update removed
  relationships

- Transaction commit failed when an unloaded record was in the
  `transaction.bucketForType.updated` array. Using recordIsMoving fixed
  this issue