Fix an access to unallocated memory in LuaRef

CheckCopyCount doesn't make sense if the ref isn't valid.