remove usage of sys/cdefs.h
add missing inclusion of sys/types.h when needed

needed for u_* types (these are uncommon names for C99 stdint types)
add missing inclusion of locale.h
add missing inclusion of fcntl.h
unistd.h: modify bsd_getopt so it matches getopt prototype

a header included later does
so the prototypes must match.
vars.c: define _PATH_CSHELL if it is not set through paths.h
file.h: warn when config.h is not used, and remove some obsolete ifdefs

strerror & co are either in posix since at least 2003 or in C99.
trap.c: do not rely on BSD specific signal name arrays
man.c: warn when GLOB_BRACE is not defined and provide its value
fgetln: always compile it, even on non __GLIBC__

the code doesnt use anything GLIBC specific so we can just compile
it everywhere.
obase.h: define some BSD-specific things used by several TUs