Fix eSE dev node bug

There can be a situation where the eSE dev node opens successfully, but
the driver fails to read the ATP length correctly. In those cases, the
driver will fail to close the dev node due to incorrect error handling.
This situation may manifest when the eSE fails to respond to ATP read
requests. This situation can also happen if the eSE is physically
disconnected.

Bug: 157762429
Test: Tested locally with eSE disconnected.
Change-Id: Ib912b3655517c4c9abf6396479437ee7fd318229
diff --git a/ese-spi-driver/StEseApi.cc b/ese-spi-driver/StEseApi.cc
index 9f046d7..d914f66 100644
--- a/ese-spi-driver/StEseApi.cc
+++ b/ese-spi-driver/StEseApi.cc
@@ -87,6 +87,9 @@
   /* Initialize SPI Driver layer */
   if (T1protocol_init(&tSpiDriver) != ESESTATUS_SUCCESS) {
     STLOG_HAL_E("T1protocol_init Failed");
+    if (intptr_t(tSpiDriver.pDevHandle) > 0) {
+      ese_ctxt.pDevHandle = tSpiDriver.pDevHandle;
+    }
     goto clean_and_return;
   }
   /* Copying device handle to ESE Lib context*/