Fix a phase-ordering bug: check the mediasize and sectorsize after we obtained access. It is possible that GPT gets to taste a disk first, which means the disk has not been opened before and it will not get opened until after we checked the mediasize and sectorsize. However, since the mediasize and sectorsize are determined at open and that happens when access is optained, checking the mediasize and sectorsize before obtaining access may result in GPT rejecting the disk.
Fix a phase-ordering bug: check the mediasize and sectorsize after
we obtained access. It is possible that GPT gets to taste a disk
first, which means the disk has not been opened before and it will
not get opened until after we checked the mediasize and sectorsize.
However, since the mediasize and sectorsize are determined at open
and that happens when access is optained, checking the mediasize
and sectorsize before obtaining access may result in GPT rejecting
the disk.

jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase