`escapeshellarg()` is pretty useless on Windows, and there is no way to
support multiple lines (i.e. line breaks). Thus, we use `proc_open()`
instead of `shell_exec()`.
We also remove some apparently superfluous empty lines from the test
expectation; that seems to match libedit behavior on Linux.
Closes GH-9474.