Fix userdata not been destructed properly

Fix an issue that object inside upvalue userdata does not get
destructed properly