build: Fix conditional compilation on availability of getpass()

Change-Id: I3aa95c1b6afe2239f24642507da8090f7f58abac
Refs: #2419
diff --git a/src/security/sec-tpm-osx.cpp b/src/security/sec-tpm-osx.cpp
index 1abfcec..4400343 100644
--- a/src/security/sec-tpm-osx.cpp
+++ b/src/security/sec-tpm-osx.cpp
@@ -328,6 +328,7 @@
                         m_impl->m_password.c_str(),
                         true);
     }
+#ifdef NDN_CXX_HAVE_GETPASS
   else if (m_impl->m_inTerminal)
     {
       // If no configured password, get password from terminal if inTerminal set.
@@ -358,6 +359,7 @@
             break;
         }
     }
+#endif // NDN_CXX_HAVE_GETPASS
   else
     {
       // If inTerminal is not set, get the password from GUI.