Optical switch comprised of electro-optic crystal based on total internal reflection