src/svgtiny.c: improve select_ctx cleanup and error handling
In the "cleanup:" routine of svgtiny_parse(), we make a few
improvements:
* The sheets are now removed from the context before destroying
them. This avoids a potential issue where destroying the context
itself (which we do afterwards) might try to access the sheets.
* If we fail to obtain a pointer to a sheet, we stop processing that
sheet. This should not happen, and if something extremely weird
happens it can hide the problem, but that's still better than the
segfault we'd get from trying to operate on an invalid pointer.
* The sheets are now removed/destroyed in reverse order, last-in
first-out.