Electroweak and dark matter constraints on a Z′ in models with a hidden valley