Bug 918339 - Remove unneeded lambda, conditionalize at_exit reg.