Fixed memory leaks & added cleanup to error exits

Fixed memory leaks in the preprocessor, and Hashtable code.
Added memory cleanup stuff to all the error exit paths.