A numerical regularization of the EFIE for three-dimensional planar structures in layered media