On the accuracy of the WKB approximation in optical dielectric waveguides