A numerical method for junctions in networks of shallow-water channels