fix edge where last records were skipped if batch contains already saved elements
fix edge where last records were skipped if batch contains already saved elements

dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq