cmake UPDATE try find crypt lib first

Because on Ubuntu 22, the function is
found (and can supposedly be used) without
linking any additional library but then
the sanitizers crash for some weird reason.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a24ddb9..15f1ac3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -246,20 +246,16 @@
     find_package(CURL 7.30.0 REQUIRED)
     target_link_libraries(netconf2 CURL::libcurl)
 
-    # crypt
-    check_function_exists(crypt HAVE_CRYPT_NOLIB)
-    if(NOT HAVE_CRYPT_NOLIB)
-        # we may need to link it explicitly
-        if(${CMAKE_SYSTEM_NAME} MATCHES "QNX")
-            set(LIBCRYPT login)
-        else()
-            set(LIBCRYPT crypt)
-        endif()
-        check_library_exists(${LIBCRYPT} crypt "" HAVE_CRYPT)
-        if(HAVE_CRYPT)
-            target_link_libraries(netconf2 ${LIBCRYPT})
-            list(APPEND CMAKE_REQUIRED_LIBRARIES ${LIBCRYPT})
-        endif()
+    # crypt (if not found, assume no library needs to be linked)
+    if(${CMAKE_SYSTEM_NAME} MATCHES "QNX")
+        set(LIBCRYPT login)
+    else()
+        set(LIBCRYPT crypt)
+    endif()
+    check_library_exists(${LIBCRYPT} crypt "" HAVE_CRYPT)
+    if(HAVE_CRYPT)
+        target_link_libraries(netconf2 ${LIBCRYPT})
+        list(APPEND CMAKE_REQUIRED_LIBRARIES ${LIBCRYPT})
     endif()
 
     # libpam