If NULL isn't defined by the time we get to stdio.h, define it.
Fix a warning and remove a spurious debug message in strdup().
Add support for clock_gettime().