All-flavor Search for a Diffuse Flux of Cosmic Neutrinos with Nine Years of ANTARES Data