Fixed #5437 -- Added GDAL prereq check to code that requires GDAL

Added if statement blocks checking whether HAS_GDAL to test
definitions that require it. Otherwise added the check to the
skipUnless decorator.