First-Principles Study of Ferroelectric and Optical Properties in Derivatives of Thiourea