patch 8.1.0288: quickfix code uses cmdidx too often

Problem:    Quickfix code uses cmdidx too often.
Solution:   Add is_loclist_cmd(). (Yegappan Lakshmanan)
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 169cb7a..14ec213 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -12529,6 +12529,20 @@
 }
 #endif
 
+#ifdef FEAT_QUICKFIX
+/*
+ * Returns TRUE if the supplied Ex cmdidx is for a location list command
+ * instead of a quickfix command.
+ */
+    int
+is_loclist_cmd(int cmdidx)
+{
+    if (cmdidx < 0 || cmdidx > CMD_SIZE)
+	return FALSE;
+    return cmdnames[cmdidx].cmd_name[0] == 'l';
+}
+#endif
+
 # if defined(FEAT_TIMERS) || defined(PROTO)
     int
 get_pressedreturn(void)