fix "Git is already running"

Previously it was possible that `magit-process' was not set to nil
even though the process has finished, causing all future calls to
`magit-run*' to fail.

For asynchronous processes this happened when the
`magit-process-client-buffer' got killed while the process was still
running (e.g. because the user killed it).  In this case the sentinel
failed to set `magit-process' to nil before it first tried to write to
the deleted buffer causing an error (which are not raised in sentinels).

Now setting `magit-process' to nil is the first thing done in
`magit-process-sentinel' and additionally an attempt to modify the
buffer is only made if it is live.

For synchronous process this could not happen, except when it receives
input, in which case the process is actually asynchronous but
`magit-run*' waits for it finish before returning.

Use a new sentinel `magit-process-input-sentinel' that sets
`magit-process' to nil in that case to.

Both sentinels now only do anything if the `process-status' is either
`exit' or `signal'.

As an additional precaution `magit-run*' now tries to recover from
causes when even the above failed.  If `magit-process' is non-nil but
has finished don't fail but tell the user to create a bug report.

Thanks to @acple and @daimrod, for pointing me into the right
direction.