Fix build on FreeBSD 10
(cherry picked from commit 1777b65e31627990f213c596853697e0e8fa8699)