main/mdocml: fix segfault for some man pages

patches to fix segmentation fault for some man pages taken from Void
Linux
7 jobs for !1821 with mdocml-segfault-fix in 1 minute and 35 seconds (queued for 15 seconds)
detached
Status Job ID Name Coverage
  Lint
passed #19404
x86_64 docker-alpine allowed to fail
lint

00:00:23

 
  Build
passed #19409
aarch64 ci-build docker-alpine
build-aarch64

00:00:44

passed #19410
armv7 ci-build docker-alpine
build-armv7

00:00:55

passed #19408
ppc64le ci-build docker-alpine
build-ppc64le

00:00:47

passed #19407
s390x ci-build docker-alpine
build-s390x

00:01:11

passed #19406
x86 ci-build docker-alpine
build-x86

00:00:30

passed #19405
x86_64 ci-build docker-alpine
build-x86_64

00:00:46