Save/restore exception handlers while generating consts