git-commit-prev-message: fix first usage

Variable `log-edit-comment-ring-index' has to be buffer-local but isn't
marked as automatically buffer-local and since `git-commit-mode' cannot
derive from `log-edit-mode' we too have to explicitly mark it as such
in `git-commit-setup'.

`git-commit-prev-message' differs from `log-edit-previous-comment' in
that it saves the current buffer content in the message ring before
replacing it in the buffer with the previous message using the latter.

`log-edit-comment-ring-index' is nil until `log-edit-previous-comment'
is first used, at which point it is initialized to point to the last
(if going backward) or the last (if going forward) message in the ring.
Because the last message is the one we just save, we have initialize
ourselves *before* calling `log-edit-previous-comment' otherwise we
would "go back" to the current message.  When going forward or when
there was no message to be save this is irrelevant, or rather doing
so would actually be counterproductive, so we don't.
backport e2ab9a1c3435bdfc0f95b8bce40194dc722f4ef5
Merge branch 'master' into next

Conflicts:
	git-commit-mode.el

Merge a backport, i.e. drop their side.