sockfilt.c: properly handle disk files, pipes and character input