DRILL-1581: Fix overflow check in casting from varchar to int