IMPALA-1566 Crash on Decimal cast.

The query,

select cast(regexp_replace('','a','b') as decimal(15,2))

Caused impala to crash because StringToDecimal would access str.ptr[0] even when
str.len=0.  In most situations, where the StringValue is created
from a literal empty string, str.ptr would point to the empty literal.
The deference would buffer overflow but not fault, since str.ptr[0] was a valid address.
When the StringVal is the result a non-trivial  expressions,
it can be the case that str.len=0 and str.ptr=NULL; hence causing a null dereference.

The fix is to not attempt the read if the length is zero.

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