restore previous winconf after committing

When finishing or aborting a commit restore the window configuration
stored in `magit-commit-previous-winconf'.  If that is nil or was
created from a frame different from the current one (most likely
because multiple commits are performed at the same time), do nothing.

The code that invokes the commit (e.g. `magit-commit-internal`) has
to set `magit-commit-previous-winconf' before doing so.  Library
`server' does not feature a hook that could be used for this purpose.

If the previous window configuration cannot be restored (because it
hasn't been stored or does not apply) do what was done before this
commit.  Just kill the buffer and live with the wrong window being
selected after that.