Rearrange code in UpdateTopicTable.

Use the topic from topic_table_ in monitor thread instead of worker thread