buaazp: only alloc lua_State once per thread to improve performance