Issue #3511649 by jurgenhaas: Ensure all cleanup is happening even if exceptions get thrown during processing a model
Closes #3511649