build: Fix misdetection of getpass

Now detection uses an explicit code fragment

Change-Id: Ib5062a0ea8fcbe69914c14b3406eb5005353a2f2
Refs: #2419
diff --git a/wscript b/wscript
index 7107235..0000b7c 100644
--- a/wscript
+++ b/wscript
@@ -52,7 +52,17 @@
                    mandatory=False)
     conf.check_cxx(lib='rt', uselib_store='RT', define_name='HAVE_RT', mandatory=False)
     conf.check_cxx(cxxflags=['-fPIC'], uselib_store='PIC', mandatory=False)
-    conf.check_cxx(function_name='getpass', header_name='unistd.h', mandatory=False)
+    conf.check_cxx(msg='Checking for function getpass', mandatory=False,
+                   define_name='HAVE_GETPASS', fragment='''
+#include <unistd.h>
+int
+main(int, char**)
+{
+  char* pass = getpass("test prompt");
+  (void)(pass);
+  return 0;
+}
+''')
 
     conf.check_osx_security(mandatory=False)