fix dump lua stack on terminate