Only enforce invariants for materialized records

If a record is deleted, its has-many relationships
are cleared. Previously, the inverse on all of the
child records (their "foreign keys") were nulled
out.

Unfortunately, this was also happening when the
has-many array had not been materializing—meaning
that deleting a record could actually cause all
of the records in its has-many relationships to
be retrieved from the adapter!

This commit only implements the above-described
behavior in instances where the has-many
relationship has been materialized. In cases where
it has *not* been materialized, only those records
which have already been coincidentally materialized
on the client have their inverse cleared, to
preserve the correct state on the client. For
unmaterialized records, we assume the adapter (or
more likely, the server, in the case of REST) will
be responsible for maintaining the invariant.

Also, this fixes the previous failing unit tests.
Sorry about that.