Fixed IMPALA-12 and IMPALA-248

Hi,

I modified impala_shell.py. IMPALA-12 and IMPALA-248 will fix by this diff.
IMPALA-012: https://issues.cloudera.org/browse/IMPALA-12
IMPALA-248: https://issues.cloudera.org/browse/IMPALA-248

Sorry for this sending, because the status of IMPALA-12 is in review.
But I need to fix IMPALA-12 to fix IMPALA-248.
Please check my diff.