sh: fix spurious newline slips in backquote expansion
From FreeBSD revision 1.43:
Instead of eating trailing newlines after inserting them into the
output buffer, don't insert them at all. This prevents a buffer
*underrun* when the substitution consists completely of newlines
(e.g. `echo`) and the byte before the source buffer to which p
points is a '\n', in which case more characters would be removed
from the output buffer than were inserted.
DragonFly-bug: <http://bugs.dragonflybsd.org/issue1588>