Fix a bug where MappedParam and MappedLocal would try to get AST mappings that hadn't yet been created (introduced by 7703322859d1b2465fca9292b5ed061264f6aa7c).
Don't close the trace before calling std::exit(), because this will prevent archiving.