samiparse: fix handling of self-closing tags
We would check the wrong string (rest of line rather than element) for the / suffix of self-closing tags, which is not only wrong but also has atrocious performance with certain strings like the garbled nonsense clusterfuzz feeds us, which might cause discoverer to time out when processing garbled SAMI files.
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=47461
FixesPlus some clean-ups / micro-optimisations.