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