GNU sed offers the ,+4d to delete the line a next four lines, but BSD
sed doesn't seem to support it (at least in macOS 10.15, but seems to do
in my 11.6 version).
Replace the usage of the extension with the equivalent syntax that works
both in BSD and GNU sed. I don't have a macOS 10.15 to check, but this
works in both my macOS 11.6 and Linux machines.
The problem was introduced in D111164. It also contains a small change to
not use cat proposed in feedback in that other diff.