Check errno as early as possible
Check errno as early as possible

Previously, the result of select() system call and errno set by it was
checked after performing several function calls, including checking
for interrupts and checkForCancelFromQD.  That made it very likely for
errno to change, losing the original value that was set by the
select().

This patch fixes it so that the errno is checked immediately after the
system call.  This should address intermittent failures in CI with
error message like this:

    ERROR","58M01","interconnect error: select: Success"

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