include cleanups: remove unused headers and add feature test macros
fix mistake in length test in getlogin_r this was actually dangerously wrong, but presumably nobody uses this broken function anymore anyway..
initial check-in, version 0.5.0