In mg_graph_write_file(), use correct return type for fwrite().
In mg_graph_write_file(), use correct return type for fwrite().

Add correct check for fwrite() error also.

donmccaughey/libmonograph,donmccaughey/libmonograph