Proposed fix for #96

I searched the c runtime source for all usages of malloc, realloc, and calloc, and made sure that each one had a proper check for NULL to detect the out of memory case, and avoid memory access violations that lead to a crash. See https://github.com/antlr/antlr3/issues/96 for details.

It would be good if Jim Idle could review these changes. There were some comments in the code indicating that some error checking was avoided for speed purposes. I did some timing tests of my compiler with a large sample of programs, and did not find a measurable difference in performance. However, the process no longer crashes when it runs out of memory :).