Fix stress test "Query ... id not found"
Fix stress test "Query ... id not found"

The Python Beeswax client would close an INSERT query before trying to
retrieve its profile and log. Impala only saves the last 25 of these by
default. So under a heavy load, it's possible the profile and log may
have been lost, and this is what we were seeing. This patch handles DML
and SELECT queries differently, retrieving the profile before closing
the query for INSERT as well.

Change-Id: I9cbd0ecd481c6c60f1609eb410a9c4227635e96d
Reviewed-on: http://gerrit.cloudera.org:8080/262
Reviewed-by: Henry Robinson <3eca10f30041813f045165784e24b5a950a6cc7e@cloudera.com>
Tested-by: Internal Jenkins

cloudera/recordservice,cloudera/recordservice,cloudera/recordservice,cloudera/recordservice,cloudera/recordservice,cloudera/recordservice,cloudera/recordservice