patch 9.0.1377: job_status() may return "dead" if the process parent changed

Problem:    job_status() may return "dead" if the process parent changed.
Solution:   Call mch_process_running() to check if the job is still alive.
diff --git a/src/os_unix.c b/src/os_unix.c
index 0dfbd49..b9514d2 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -5863,10 +5863,17 @@
 # endif
     if (wait_pid == -1)
     {
+	int waitpid_errno = errno;
+	if (waitpid_errno == ECHILD && mch_process_running(job->jv_pid))
+	    // The process is alive, but it was probably reparented (for
+	    // example by ptrace called by a debugger like lldb or gdb).
+	    // Note: This assumes that process IDs are not reused.
+	    return "run";
+
 	// process must have exited
 	if (job->jv_status < JOB_ENDED)
 	    ch_log(job->jv_channel, "Job no longer exists: %s",
-							      strerror(errno));
+						      strerror(waitpid_errno));
 	goto return_dead;
     }
     if (wait_pid == 0)