py: Improve memory management for parser; add lexer error for bad line cont.