Three-dimensional analysis of bending losses in dielectric optical waveguides with arbitrary refractive-index profile