title: createOrUpdateInRealm:withObject: unexpectedly resets to many relationship when updated with the same object
body: <p>It seems like to many relationships are reset when you update a realm object with itself.  The following code will result in the persons dogs becoming orphaned.</p>
  
  <pre><code>RLMRealm *realm = [RLMRealm defaultRealm];
  [realm transactionWithBlock:^{
      self.person.name = @"Fred";
      NSLog(@"dogs before: %d", self.person.dogs.count);
      self.person = [Person createOrUpdateInRealm:realm withObject:self.person];
      NSLog(@"dogs after: %d", self.person.dogs.count);
  }];
  </code></pre>
  
  <p><em>Console Output</em></p>
  
  <pre><code>dogs before: 1
  dogs after: 0
  </code></pre>
  
  <p>I used create or update as at this point I don't know whether I have a new object or a previously persisted object.</p>
  
  <p>I have functioning alternative but <strong>I am curious as to why this doesn't work?</strong>  My best guess was it is something to do with key value coding used in mapping the data to the object returning some "unexpected" value.</p>
  
  <p><strong>Is there any appropriate way to avoid this problem or should I just stick with my alternative approach?</strong></p>
  
  <p><em>Functioning alternative</em></p>
  
  <pre><code>RLMRealm *realm = [RLMRealm defaultRealm];
  [realm transactionWithBlock:^{
      if (![self.person realm]) {
          [realm addObject:self.person];
      }
  
      self.person.name = @"Fred";
  }];
  </code></pre>