tests: fix test-patch.t on pickier /bin/sh implementations
This is a graft of 0b39edeff033 and f44306940c94 from default because
I'm tired of seeing the FreeBSD build be red on stable. See those
revisions for details on what's going on here.
#require docutils gettext $ $TESTDIR/check-gendoc zh_CN checking for parse errors