Fix periodic sync

Signed-off-by: Jonas Kalderstam <jonas@kalderstam.se>
Fix applyBatch backrefs

Can not use backrefs in combination with update-feeds,
since the update operation returns number of changed rows
(always 1). However, the id is known so use that instead.

Signed-off-by: Jonas Kalderstam <jonas@kalderstam.se>