Add the SQLITE_STATUS_MALLOC_COUNT option for sqlite3_status().

FossilOrigin-Name: 8f8e442b3af553753e25c304efa289b626e3a227
diff --git a/test/tester.tcl b/test/tester.tcl
index d921955..f485a6d 100644
--- a/test/tester.tcl
+++ b/test/tester.tcl
@@ -441,8 +441,10 @@
     puts "$sqlite_open_file_count files were left open"
     incr nErr
   }
-  if {[sqlite3_memory_used]>0} {
-    puts "Unfreed memory: [sqlite3_memory_used] bytes"
+  if {[lindex [sqlite3_status SQLITE_STATUS_MALLOC_COUNT 0] 1]>0 ||
+              [sqlite3_memory_used]>0} {
+    puts "Unfreed memory: [sqlite3_memory_used] bytes in\
+         [lindex [sqlite3_status SQLITE_STATUS_MALLOC_COUNT 0] 1] allocations"
     incr nErr
     ifcapable memdebug||mem5||(mem3&&debug) {
       puts "Writing unfreed memory log to \"./memleak.txt\""
@@ -489,6 +491,9 @@
   set val [format {now %10d  max %10d  max-size %10d} \
               [lindex $x 1] [lindex $x 2] [lindex $y 2]]
   puts "Memory used:          $val"
+  set x [sqlite3_status SQLITE_STATUS_MALLOC_COUNT 0]
+  set val [format {now %10d  max %10d} [lindex $x 1] [lindex $x 2]]
+  puts "Allocation count:     $val"
   set x [sqlite3_status SQLITE_STATUS_PAGECACHE_USED 0]
   set y [sqlite3_status SQLITE_STATUS_PAGECACHE_SIZE 0]
   set val [format {now %10d  max %10d  max-size %10d} \