patch 8.2.0880: leaking memory when using searchcount()

Problem:    Leaking memory when using searchcount().
Solution:   Free the last used search pattern.
diff --git a/src/search.c b/src/search.c
index e0b0f9b..a6b60f6 100644
--- a/src/search.c
+++ b/src/search.c
@@ -4147,6 +4147,7 @@
     {
 	if (*pattern == NUL)
 	    goto the_end;
+	vim_free(spats[last_idx].pat);
 	spats[last_idx].pat = vim_strsave(pattern);
     }
     if (spats[last_idx].pat == NULL || *spats[last_idx].pat == NUL)