Use method to check for successful file creation instead on NULL.

Don’t check for the file handle to be NULL, instead use the
is_open() method.
refs #7284