Fix pgbench progress report behaviour when pgbench or a query gets stuck.
Fix pgbench progress report behaviour when pgbench or a query gets stuck.

There were two issues here. First, if a query got stuck so that it took
e.g. 5 seconds, and progress interval was 1 second, no progress reports were
printed until the query returned. Fix so that we wake up specifically to
print the progress report. Secondly, if pgbench got stuck so that it would
nevertheless not print a progress report on time, and enough time passes
that it's already time to print the next progress report, just skip the one
that was missed. Before this patch, it would print the missed one with 0 TPS
immediately after the previous one.

Fabien Coelho. Backpatch to 9.4, where progress reports were added.

greenplum-db/gpdb,adam8157/gpdb,50wu/gpdb,greenplum-db/gpdb,xinzweb/gpdb,greenplum-db/gpdb,ashwinstar/gpdb,lisakowen/gpdb,adam8157/gpdb,adam8157/gpdb,lisakowen/gpdb,adam8157/gpdb,lisakowen/gpdb,xinzweb/gpdb,xinzweb/gpdb,greenplum-db/gpdb,ashwinstar/gpdb,ashwinstar/gpdb,lisakowen/gpdb,jmcatamney/gpdb,50wu/gpdb,ashwinstar/gpdb,xinzweb/gpdb,xinzweb/gpdb,50wu/gpdb,jmcatamney/gpdb,ashwinstar/gpdb,adam8157/gpdb,jmcatamney/gpdb,xinzweb/gpdb,lisakowen/gpdb,adam8157/gpdb,greenplum-db/gpdb,ashwinstar/gpdb,jmcatamney/gpdb,greenplum-db/gpdb,50wu/gpdb,ashwinstar/gpdb,jmcatamney/gpdb,adam8157/gpdb,greenplum-db/gpdb,jmcatamney/gpdb,lisakowen/gpdb,lisakowen/gpdb,xinzweb/gpdb,50wu/gpdb,jmcatamney/gpdb,greenplum-db/gpdb,xinzweb/gpdb,lisakowen/gpdb,adam8157/gpdb,50wu/gpdb,jmcatamney/gpdb,50wu/gpdb,ashwinstar/gpdb,50wu/gpdb