Exact zero modes in a quantum compass chain under inhomogeneous transverse fields