Update lemon.c to August 2012 version from SQLite.

- Add a missing check for out-of-memory in the lemon code generator.
- Fix a total unimportant file descriptor leak in lemon. This is to silence warning messages.
- Fix a bug in lemon in computation of which non-terminals can generate an empty string. This bug and the fix make absolutely no difference for the grammar used by SQLite, but it can make a difference when lemon is used in other grammars.
- In Lemon, when comparing the output to the *.h file to see if it has changed, make sure that the proposed new output and the preexisting output are the same size before deciding that they are the same.