patch 8.0.0580: cannot set the valid flag with setqflist()

Problem:    Cannot set the valid flag with setqflist().
Solution:   Add the "valid" argument. (Yegappan Lakshmanan, closes #1642)
diff --git a/src/quickfix.c b/src/quickfix.c
index b28a321..ea7f580 100644
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -4779,6 +4779,10 @@
 	    bufnum = 0;
 	}
 
+	/* If the 'valid' field is present it overrules the detected value. */
+	if ((dict_find(d, (char_u *)"valid", -1)) != NULL)
+	    valid = (int)get_dict_number(d, (char_u *)"valid");
+
 	status =  qf_add_entry(qi,
 			       NULL,	    /* dir */
 			       filename,