guarantee a consistent ordering in table meta reads, and fix a deadlock in table_wait
adding comment clarifying table_wait loop