patch 8.2.5022: 'completefunc'/'omnifunc' error does not end completion

Problem:    'completefunc'/'omnifunc' error does not end completion.
Solution:   Check if there was an error or exception. (closes #10486,
            closes #4218)
diff --git a/src/insexpand.c b/src/insexpand.c
index fd1218f..89e0ebd 100644
--- a/src/insexpand.c
+++ b/src/insexpand.c
@@ -4522,11 +4522,12 @@
 	return FAIL;
     }
 
-    // Return value -2 means the user complete function wants to
-    // cancel the complete without an error.
-    // Return value -3 does the same as -2 and leaves CTRL-X mode.
-    if (col == -2)
+    // Return value -2 means the user complete function wants to cancel the
+    // complete without an error, do the same if the function did not execute
+    // successfully.
+    if (col == -2 || aborting())
 	return FAIL;
+    // Return value -3 does the same as -2 and leaves CTRL-X mode.
     if (col == -3)
     {
 	ctrl_x_mode = CTRL_X_NORMAL;