Call Function::eraseFromParent() when codegen fails
Call Function::eraseFromParent() when codegen fails

Aborting codegen mid-function without erasing the function can result
in a corrupt module.

Change-Id: I64b518c8286195d78e68c2df5397a8843f6badc3
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4632
Reviewed-by: Skye Wanderman-Milne <6d4b168ab637b0a20cc9dbf96abb2537f372f946@cloudera.com>
Tested-by: jenkins

cloudera/Impala,cloudera/Impala,michaelhkw/incubator-impala,michaelhkw/incubator-impala,cloudera/Impala,cloudera/Impala,cloudera/Impala,michaelhkw/incubator-impala,michaelhkw/incubator-impala,cloudera/Impala,michaelhkw/incubator-impala,michaelhkw/incubator-impala,cloudera/Impala,michaelhkw/incubator-impala