Theory of the coherence of topological lasers