Fixing bug when synchronizing models with a has one relation.

The code that clears deleted models after a sync of a collection was causing a bug for has one relations, since it didn't check whether the relation was a has one or has many.