gh-59: fix FreeBSD and other POSIX systems.
Merge remote-tracking branch 'origin/stable'