IMPALA-1392: Fix crash from UDFs that throw exceptions.

Change-Id: Ic8775d6344aba9655511f99c0a1760e8e148d0cf
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/5243
Reviewed-by: Nong Li <nong@cloudera.com>
Tested-by: jenkins