alphasort(3)/scandir(3): Sync prototypes with POSIX.1-2008.
These functions have been added to the latest issue (7) of the
OpenGroup specifications. Since our default still is POSIX.1-2001,
make them visible if either _POSIX_C_SOURCE >= 200809 is defined
or if _POSIX_SOURCE is not defined (which was what we had
previously). The latter condition is left in for backwards
compatibility and can be removed once we switch to 200809.
Also fix some consumers of scandir(3) which we have in base.
This fixes the build of devel/libcompizconfig.
I've checked this change with 22 out of 114 packages that use
scandir(), and aside from some warnings, there were no issues.
Reported-by: alexh
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue1896>
Based-on: FreeBSD