expect: fix build on freebsd? (close #981)