perror: work around FreeBSD bug