Make cancel_callback check duplicates luaL_unref only in debug mode.