Beam-power deposition in a 4-MW target station for a muon collider or a neutrino factory