Detect end of comments.
End of metadata section does not imply end of comment.
Bail on nested metadata sections.
Reset last_endmeta when entering a new metadata section.

This allows us to detect invalid metadata sections that come after
a valid one.
Reword "invalid metadata section found" message.

Just because there was an invalid metadata section, it doesn't mean that
there wasn't a valid section earlier in the file (which lead to the file
being processed).
Simplify pattern