Fix #451: Build broken on OSX.

Problem:  Build breaks in OSX if macports ncurses present, due to
          header conflict involving 'term.h'.
Solution: Modify include search order.
Changed testdir/Makefile to use Makefile wildcards instead of SUFFIXES
Simplify tricky preprocessor tests in ff_check_visited()
Remove simpler cases of OOM error handling (after *alloc calls)

By simpler cases I mean cases where the OOM error is not expected to be handled
by the caller of the function that calls `alloc`, `lalloc`, `xrealloc`,
`xmalloc`, `alloc_clear`, and `lalloc_clear`.

These are the functions that:

 - Do not return an allocated buffer
 - Have OOM as the only error condition

I took note of the functions that expect the caller to handle the OOM error and
will go through them to check all the callers that may be handling OOM error in
future commits.

I'm ignoring eval.c and ex_*.c in this series of commits as these files are
being heavily refactored by @ZyX-I.