Add tests for head

This exposed one issue in head.c -- printf was not flushing and
file names could appear after file contents instead of before.

The issue is fixed by calling xflush after xprintf.
2 files changed