ENG-6942: Refactor bulk loader to fix deadlock.

same as before for import.