Add retry_on_conflict support to bulk api

Closes #623