patch 8.1.0590: when a job ends the closed channels are not handled

Problem:    When a job ends the closed channels are not handled.
Solution:   When a job is detected to have ended, check the channels again.
            (closes #3530)
diff --git a/src/proto/channel.pro b/src/proto/channel.pro
index 57b958a..e11cd3a 100644
--- a/src/proto/channel.pro
+++ b/src/proto/channel.pro
@@ -65,7 +65,7 @@
 void job_set_options(job_T *job, jobopt_T *opt);
 void job_stop_on_exit(void);
 int has_pending_job(void);
-void job_check_ended(void);
+int job_check_ended(void);
 job_T *job_start(typval_T *argvars, char **argv_arg, jobopt_T *opt_arg, int is_terminal);
 char *job_status(job_T *job);
 void job_info(job_T *job, dict_T *dict);