Fix orphaned records when running update

When DataObject::update() is run with relation fields and the relationship
is new the relationship ID was not set on the DataObject. This patch fixes
this. Fixes issue 6195 in open.silverstripe.org.

New unit test created for the scenario of DataObject::update() creating new relation records as well. This test does not pass on 3.1 but passes with the new changes.