magit-with-git-editor-setup: respect server-socket-dir
add option magit-git-editor

This changes `magit-with-git-editor-setup's default behaviour:
If $GIT_EDITOR is set and contains the substring "emacsclient"
then that is used.  If the former is unset try $EDITOR instead.
Only if that fails fallback to the old default behaviour of
setting $GIT_EDITOR temporarly (and even if the user has
also configured it explicitly).
Merge branch 'hotfix'
`magit-git-editor': minor docstring fixes

Signed-off-by: Pieter Praet <pieter@praet.org>
`magit-with-git-editor-setup': correct path to server socket

`server-socket-dir' == path to server socket dir *sans* trailing slash,
so we'd end up calling emacsclient(1) with e.g. "-s /tmp/emacs1000server"
instead of "-s /tmp/emacs1000/server".

Adding the slash in the format string might result in "-s nil/server",
so use an `ignore-errors'-wrapped `file-name-as-directory' instead.

Signed-off-by: Pieter Praet <pieter@praet.org>
Merge pull request #782 from praet/git-editor

minor magit-git-editor fixes