These reactions are completely accurate when heating together the dry salts. Perhaps better described as:
Cl2 (g) + 2 NaBr (s) → 2 NaCl (s) + Br2 (g)
Br2 (l) + 2 KI (s) → 2 KBr (s) + I2 (g)
However, if an aqueous solution then things get more complex due to disproportionation reactions, as for example:
Br2 + H2O <---> HOBr + HBr
3 HOBr --> HBrO3 + 2 HBr
which then react with the KI.