Theoretical study of the stability of the tetradymite-like phases of Sb$_2$S$_3$, Bi$_2$S$_3$, and Sb$_2$Se$_3$