[SPARK-4573] [SQL] Add SettableStructObjectInspector support in "wrap" function

Hive UDAF may create an customized object constructed by SettableStructObjectInspector, this is critical when integrate Hive UDAF with the refactor-ed UDAF interface.

Performance issue in `wrap/unwrap` since more match cases added, will do it in another PR.
Since this didn't break the pull request builder and it's nighttime now (so we're probably not merging tons of stuff), I'm going to hold off on reverting this for a little bit to see if we can come up with a quick hotfix.  Otherwise, I'll revert this commit when I get up tomorrow.