Bounds on axionlike particles from the diffuse supernova flux