Fix race condition when figuring out positions for buildpacks.

- Creates a locking table for full table locks

[#80149038]