IMPALA-1105 : TRUNC(TIMESTAMP) malformed input from cast

Fixed crash when TRUNC(TIMESTAMP) was passed malformed timestamp values. The fix
is for CAST(STRING to TIMESTAMP), returns NULL when STRING is malformed.

Change-Id: Ie13395d740b2587dfb59c2f677b3ed3d0d4e992f
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/3583
Reviewed-by: Victor Bittorf <victor.bittorf@cloudera.com>
Tested-by: jenkins