A generalized WKB approach to propagation in inhomogeneous dielectric waveguides