Handle opendir() errors gracefully in gp_replica_check.
Handle opendir() errors gracefully in gp_replica_check.

The return value from AllocateDir() was not checked. That's not
mandatory, if you immediately pass the return value to ReadDir(), as
explained in the comment in ReadDir(), but you can't rely on that if
you do anything in between the calls that might change errno. We were
requesting a checkpoint, and doing many other things in between.

Also, don't try to open the directory in the mirror until after the
checkpoint. Before the checkpoint, the directory might not exist in
the mirror yet. (I don't think there's any guarantee that it will exist
after requesting the checkpoint either, but we're taking chances with
that here anyway. At least it makes it a lot more likely.)

I think this explains the occasional errors like:

ERROR:  could not open directory "/tmp/build/e18b2f02/gpdb_src/gpAux/gpdemo/datadirs/dbfast_mirror1/demoDataDir0/base/513914": Success (fd.c:2207)

that we've been seeing on the pipeline. Or at least, if this doesn't fix
them, we should now get a more correct error message than "Success".

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