Implement petrinet_destroy and make petrinet_read_in aware of errors.