C program to count occurrences of all words in a file