[SPARK-4785] [SQL] Support udf instance ser/de after initialization

UDF contract change in Hive 0.13.1. In Hive 0.12.0, it's always safe to construct and initialize a fresh UDF object on worker side, while in Hive 0.13.1, UDF objects should only be initialized on driver side and then serialized to the worker side. We provide the ability to serialize the initialized UDF instance and deserialize them cross process boundary.
Actually, how about removing the `alwaysCreateNewInstance` argument (which is confusing), and define a new `HiveSimpleUdfWrapper` that overrides `createFunction`, and always return a new instance?