patch 8.2.0212: missing search/substitute pattern hardly tested

Problem:    Missing search/substitute pattern hardly tested.
Solution:   Add test_clear_search_pat() and tests. (Yegappan Lakshmanan,
            closes #5579)
diff --git a/src/search.c b/src/search.c
index 3b310dc..0891557 100644
--- a/src/search.c
+++ b/src/search.c
@@ -380,6 +380,12 @@
 }
 #endif
 
+    void
+free_last_pat(int idx)
+{
+    VIM_CLEAR(spats[idx].pat);
+}
+
 /*
  * Return TRUE when case should be ignored for search pattern "pat".
  * Uses the 'ignorecase' and 'smartcase' options.