IMPALA-2528: Fix ASAN failure of nanoseconds_add()
IMPALA-2528: Fix ASAN failure of nanoseconds_add()

The failure is

Value of: result != NULL
Actual: false
Expected: true
nanoseconds_add(cast('1400-01-01 00:00:00' as timestamp), -8446744073709551616)

The code had a "interval > 0" check to prevent this but that didn't work with
clang/asan. The problem could be undefined behavior with the int overflow.
Now the looping logic avoids overflows.

Change-Id: I2e71c05cbb2224d93c28089ebc21f253ee963e19
Reviewed-on: http://gerrit.cloudera.org:8080/1229
Reviewed-by: Dan Hecht <20ebd99959f0f6e5dcb0fc319b4d8ef53a16b5fb@cloudera.com>
Tested-by: Internal Jenkins

kapilrastogi/Impala,kapilrastogi/Impala,kapilrastogi/Impala,kapilrastogi/Impala,kapilrastogi/Impala,kapilrastogi/Impala,kapilrastogi/Impala