Draft: Rework hash table usage for directory-async
This reworks e3d7f0b3 from !1375 (merged), which was reverted in b84e0ce5 due to causing crashes.
The ready callbacks are now only called after swapping out the ready callbacks hash table with a new table. This prevents previously existing errors caused by iterating over values of a changing hash table.