THRIFT-4376: fix more high impact coverity defects
Led to the discovery of incorrect lua socket error handling.

This closes #1405
diff --git a/lib/cpp/test/TServerIntegrationTest.cpp b/lib/cpp/test/TServerIntegrationTest.cpp
index 12657d4..5f7b2e8 100644
--- a/lib/cpp/test/TServerIntegrationTest.cpp
+++ b/lib/cpp/test/TServerIntegrationTest.cpp
@@ -265,6 +265,7 @@
    */
   int getServerPort() {
     TServerSocket* pSock = dynamic_cast<TServerSocket*>(pServer->getServerTransport().get());
+    if (!pSock) { throw std::logic_error("how come?"); }
     return pSock->getPort();
   }