lua : fix some mem leaks