Fix bad query expiration if --idle_query_timeout=0

Query expiration should take the minimum of --idle_query_timeout and
QUERY_TIMEOUT_S as the timeout for each query, but if either is 0 it
should be ignored.

This patch fixes that behaviour - previously if --idle_query_timeout was
0 it was taken as the timeout (and queries with 0 timeout are considered
not to be eligible for expiration).

There's a new test which confirms the fix.

Change-Id: Ieb960866b818a630f3d3c427d9454ca2ffd3f87c
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/3913
Reviewed-by: Henry Robinson <henry@cloudera.com>
Reviewed-by: Daniel Hecht <dhecht@cloudera.com>
Tested-by: jenkins
(cherry picked from commit 35f8ef45ef8774a6a70d3b35fc20ea14ab7c0d49)
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/3942