Solaris build fixes: pick the right curses more of the time
Define some macros to stop Solaris curses headers from breaking the STL
Update osx/config.h with new configure headers
use configure to define NOMACROS

(added in 9ec808a4c)
Support for dirents without d_type (e.g. Solaris)
use configure to detect dirent.d_type
Solaris build fixes: fallback to _XOPEN_NAME_MAX if defined
Solaris build fixes: use memset instead of bzero
Solaris build fixes: detect <termios.h> in configure

The header is already used appropriately in the code.
Solaris build fixes: use _sys_errs if available
Merge a handful of old and new fixes for the build on Solaris

Note that it does not successfully compile yet due to missing flock() on this
platform.
osx/config.h: add some missed defines