Pivot updates recorded only if something updated

The sync() method currently returns ids for all attached models when an update is made if they have attributes to update also - regardless of whether an update actually took place.

This fix ensures that only those pivot records that actually got updated are returned, as not to include false positives.