THRIFT-5845: Return TException for union check in Write

Client: go

In compiler generated Write method for union types, return a TException
(TProtocolException) when the number of fields set is not exactly 1, to
help customer logic to decide whether to reuse a connection after an
error.

While I'm here, also do the same thing for the uniqueness check failure
for set fields in Write as well.
diff --git a/lib/go/test/UnionBinaryTest.thrift b/lib/go/test/UnionBinaryTest.thrift
index f77112b..8bce38d 100644
--- a/lib/go/test/UnionBinaryTest.thrift
+++ b/lib/go/test/UnionBinaryTest.thrift
@@ -21,5 +21,6 @@
 union Sample {
   1: map<string, string> u1,
   2: binary u2,
-  3: list<string> u3
+  3: list<string> u3,
+  4: set<string> u4,
 }