Fix the build of the testmain target. This target compiles a Forth
interpreter that can be run on the system and as such cannot be
compiled against libbstand. On the one hand this means we need to
include the usual headers for system interfaces that we use and
on the the other hand we can only use standard system interfaces.

While here, define local variables only when needed to make this
WARNS=2 clean on amd64.

PR:		172542
Obtained from:	peterj@
Pointed out by: Jan Beich <jbeich@tormail.org>