fix: fclose(NULL) in the VRML plugin when current directory is not writable
The VRML plugin writes PNG files of each node in the graph alongside the VRML
output that then references these files. If you give no output location (do not
pass `-o` to dot), the VRML output is written to stdout and the node PNG files
are written to the current directory. However, the plugin was not checking
whether opening of these PNG files succeeded. As a result, if the current
directory was not writable, it would end up calling fclose() with a NULL
pointer.
This change makes the plugin report the failure to open PNG files and cause dot
to eventually exit with non-zero. Note that VRML processing is not stopped, so
the user can still get complete VRML output, albeit missing the associated PNG
files that will be referenced.
The test case included in this commit does not necessarily reproduce the failure
prior to these changes. This is because Glibc allows fclose(NULL). However, this
is beyond the spec and other libcs do not provide these guarantees.