ENG-6942: Refactor bulk loader to fix deadlock.