Similar to the frontend `web/src/topic_link_util.ts`, we introduce a backend module to avoid generating broken channe/topic links. Fixes part of #34608