added consistent memory cleanup to load_cached_model, and line number information on error
Authored by: anallyst 2011-03-17
Parent: [r3220]
Child: [r3222]