More parser fixes from testing.

* Moved reallocs to use the ProtobufCAllocator.
* Better handling of the State structure. Allocating error string in
  advance; freeing memory.
* Fall gracefully out of allocation errors.