Simplify readFile function
replace open/read/close with f variants
MSVC warns that open/read/close are deprecated.
replace fstat with stat
Allows removing various fclose calls and simplifying the code further.
Signed-off-by: Rosen Penev rosenp@gmail.com