BUG/MINOR: lua: executes the function destroying the Lua session in safe mode

When we destroy the Lua session, we manipulates Lua stack,
so errors can raises. It will be better to catch these errors.

This patch should be backported in 1.6 and 1.7
1 file changed