Fix Haiku build

NFD_OpenDialog

Haiku needs libbsd to use posix_openpty
some more coverity crash prevention