patch 8.2.5047: CurSearch highlight is often wrong

Problem:    CurSearch highlight is often wrong.
Solution:   Remember the last highlighted position and redraw when needed.
diff --git a/src/match.c b/src/match.c
index 1078424..8280da7 100644
--- a/src/match.c
+++ b/src/match.c
@@ -798,7 +798,11 @@
 		// Highlight the match were the cursor is using the CurSearch
 		// group.
 		if (shl == search_hl && shl->has_cursor)
+		{
 		    shl->attr_cur = HL_ATTR(HLF_LC);
+		    if (shl->attr_cur != shl->attr)
+			search_hl_has_cursor_lnum = lnum;
+		}
 
 	    }
 	    else if (col == shl->endcol)