patch 8.0.0746: when :term fails the job is not properly cleaned up

Problem:    When :term fails the job is not properly cleaned up.
Solution:   Free the terminal. Handle a job that failed to start. (closes
            #1858)
diff --git a/src/channel.c b/src/channel.c
index 7af19b0..c79107c 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -5189,6 +5189,11 @@
 	    return 0;
 	}
     }
+    if (job->jv_status == JOB_FAILED)
+    {
+	ch_log(job->jv_channel, "Job failed to start, job_stop() skipped");
+	return 0;
+    }
     if (job->jv_status == JOB_ENDED)
     {
 	ch_log(job->jv_channel, "Job has already ended, job_stop() skipped");