Dispersive analysis of ω→3π and ϕ→3π decays