Fix early set of error code.

If we set the error status in loadRuntime(), we have no clean way to fall
back to the default driver (since it retains the error flag). Setting the
error status later (after all other options) is the proper way to do this.

Change-Id: I0a31b89d558d2af13ba4ca72fa7e04bb4e27a716
diff --git a/rsContext.cpp b/rsContext.cpp
index d3709ba..221d572 100644
--- a/rsContext.cpp
+++ b/rsContext.cpp
@@ -212,7 +212,6 @@
 
     driverSO = dlopen(filename, RTLD_LAZY);
     if (driverSO == NULL) {
-        rsc->setError(RS_ERROR_FATAL_DRIVER, "Failed loading RS driver");
         ALOGE("Failed loading RS driver: %s", dlerror());
         return false;
     }
@@ -230,14 +229,12 @@
     }
 
     if (halInit == NULL) {
-        rsc->setError(RS_ERROR_FATAL_DRIVER, "Failed to find rsdHalInit");
         dlclose(driverSO);
         ALOGE("Failed to find rsdHalInit: %s", dlerror());
         return false;
     }
 
     if (!(*halInit)(rsc, 0, 0)) {
-        rsc->setError(RS_ERROR_FATAL_DRIVER, "Failed initializing RS Driver");
         dlclose(driverSO);
         ALOGE("Hal init failed");
         return false;
@@ -293,6 +290,7 @@
     if (loadDefault) {
         if (!loadRuntime("libRSDriver.so", rsc)) {
             ALOGE("Failed to load default runtime!");
+            rsc->setError(RS_ERROR_FATAL_DRIVER, "Failed loading RS driver");
             return NULL;
         }
     }