with-editor-looping-editor: use shell built-in `wait'
with-editor: fix typo in comment
with-editor: support alternative way of choosing the envvar

The environment variable to be set could previously be chosen by
providing the optional ENVVAR argument which has to be literal string.

Now if `with-editor--envvar' is let-bound around `with-editor' this
is respected if ENVVAR is not also set.  This is intended for internal
use.
with-editor: always use looping editor on remote

When `default-directory' is a remote directory accessed using Tramp,
then use the looping editor instead of the emacsclient with the looping
editor as fallback.  This isn't a bugfix, for existing code we also take
care of this in our advice to `start-file-process'.   This prepares for
upcoming additions.
with-editor-set-process-filter: arrange for our filter to run last
with-editor-output-filter: new function

Create `with-editor-output-filter' from code previously
in `with-editor-process-filter'.  This prepares for upcoming
additions which expect such a filter that only takes a STRING
argument and not also a PROCESS argument.

On such future use is as `eshell-preoutput-filter-functions' which
expects that a string (which is then inserted) or nil is returned.