various header cleanups, some related to _BSD_SOURCE addition