Check for fopen() failing

Don't just die with SEGV if fopen fails.
1 file changed