[sdb] Add a lower level lock and use it in place of the loader lock in some places.