Apply fix for KT-57848 to our JNI compilation that uses C++ stdlib APIs.

Test: ./sqlite/scripts/runConformanceTest in my MacBook.
Change-Id: I96d70505383975b22505c79f520ec19b76d524ea
diff --git a/sqlite/sqlite-bundled/build.gradle b/sqlite/sqlite-bundled/build.gradle
index bb24383..6a9ab0d 100644
--- a/sqlite/sqlite-bundled/build.gradle
+++ b/sqlite/sqlite-bundled/build.gradle
@@ -134,6 +134,10 @@
             )
             // dynamically link with the output of SQLite
             nativeCompilation.linkWith(sqliteCompilation)
+            if (nativeCompilation.konanTarget.family == Family.OSX) {
+                // KT-57848
+                nativeCompilation.freeArgs.addAll("-Dat_quick_exit=atexit", "-Dquick_exit=exit")
+            }
         }
         configureTargets(requiredNativeTargets)
     }