patch 8.2.4668: buffer allocation failures insufficiently tested

Problem:    Buffer allocation failures insufficiently tested.
Solution:   Add tests for memory allocation failures. (Yegappan Lakshmanan,
            closes #10064)
diff --git a/src/popupwin.c b/src/popupwin.c
index 883372c..c3251ea 100644
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -1997,7 +1997,10 @@
 	new_buffer = TRUE;
 	buf = buflist_new(NULL, NULL, (linenr_T)0, BLN_NEW|BLN_DUMMY|BLN_REUSE);
 	if (buf == NULL)
+	{
+	    win_free_popup(wp);
 	    return NULL;
+	}
 	ml_open(buf);
 
 	win_init_popup_win(wp, buf);