bsdgrep: Work-around for segmentation fault.

Fix by David Carlier.

MFC of r272127
Obtained from:	HardenedBSD
PR:		167921