Fix build on SunOS with native curses.

* Detect isblank in configure script.
Fix build on OmniOS.

* Add -fno-stack-protector to CFLAGS to fix link error for SunOS.
* Patch configure.ac and regenerate the related stuff.
* Buildlink sysutils/file for libmagic.
* Detect dirfd, setprogname and htonll in configure script.
* Create PLIST for NetBSD and SunOS.
Needs the same __fpending workaround on Cygwin as devel/m4.