src/svgtiny.c: cleanup dom nodes and select ctx after svgtiny_parse()
The svgtiny_parse() function has a "cleanup:" label at the end
that... cleans up, and then returns whatever result is set. Looking
back through this function, though, we see that none of "svg",
"document", or "state.select_ctx" are cleaned up separately in the two
places where we jump to the "cleanup:" label. Thus those resources may
be leaked.
To prevent that, we just have to move the "cleanup:" label up a bit,
so that it includes the clean-up for "svg", "document", and
"state.select_ctx". We also add a new guard that prevents us from
clobbering a real error code with an error from the context destructor
in the cleanup routine.