IMPALA-7415: Fix flakiness in test_multiline_queries_in_history
IMPALA-7415: Fix flakiness in test_multiline_queries_in_history

This fixes a flakiness in test_multiline_queries_in_history wherein a
part of the shell prompt would be absorbed in a previous regex search
that would ultimately result in the failure of the subsequent regex
search that looks for the prompt.

Also fixed a few formatting issues flagged by flake8.

Change-Id: If7474f832a88bc29b321f21b050c9665294e63d5
Reviewed-on: http://gerrit.cloudera.org:8080/11175
Reviewed-by: Impala Public Jenkins <039b6b20426ff68ebe492b3021890d8c8fd010c9@cloudera.com>
Tested-by: Impala Public Jenkins <039b6b20426ff68ebe492b3021890d8c8fd010c9@cloudera.com>

cloudera/Impala,cloudera/Impala,cloudera/Impala,cloudera/Impala,cloudera/Impala,cloudera/Impala,cloudera/Impala