This should fix some Coverity warnings about memory management
in the lemon tool (less critical), but also fix improper
memory accesses in the generated parsers (labeled critical
by Coverity).
Ref: https://sqlite.org/forum/forumpost/edecf32da3
This moves the generated files out of the source tree and into
the build directory. They are now regenerated each time they are
needed, based on the timestamp of the generated file compared to
the timestamp of the lemon file.
To do this, we also bundle lemon into the thirdparty directory
and build it for ourselves since it is a very tiny program and
not all platforms seem to distribute it in a consistent manner.
Fixes https://gitlab.com/kicad/code/kicad/issues/5013