Issue #20246: Fix test failures on FreeBSD. Patch by Ryan Smith-Roberts.