### Godot version

4.0.stable

### System information

Linux 5.10.167-1-MANJARO

### Issue description

After roughly 2-billion calls to `rid_allocate_id()`, if you then make a call to a server that creates and returns a new RID, and no other calls have been made to that function. The server will then return an invalid RID.

Attempting to free this RID will make godot crash without errors, unlike what normally happens when you try to free an invalid RID.

This happens because the function that generates the RID only uses the lower 31 bits of the generated id from `rid_allocate_id`. In combination with an index into the array of elements of that `RID_Owner`. So if you generate `2^31` total ids, it will overflow (without any actual integer overflow happening, as the id is 64 bits long) and become 0. then if the array is empty, the index is 0 as well, so it will generate an rid = 0.

### Steps to reproduce

Call `rid_allocate_id()` until the returned value is `0x7FFFFFFF`. Then make a call (such as `PhysicsServer3D.area_create()`) which will print an error in the console and return an invalid RID.

### Minimal reproduction project

Let the project run, eventually (takes a couple of minutes on my machine) the error will show up and a print message indicating that an invalid RID has been returned.
[repro.zip](https://github.com/godotengine/godot/files/10943606/repro.zip)

T *mem = get_or_null(p_rid, true);
		ERR_FAIL_COND(!mem);
		memnew_placement(mem, T(p_value));
	}
	_FORCE_INLINE_ bool owns(const RID &p_rid) const {
		if (THREAD_SAFE) {
			spin_lock.lock();
		}
		uint64_t id = p_rid.get_id();
		uint32_t idx = uint32_t(id & 0xFFFFFFFF);
		if (unlikely(idx >= max_alloc)) {
			if (THREAD_SAFE) {
				spin_lock.unlock();
			}
			return false;
		}
		uint32_t idx_chunk = idx / elements_in_chunk;
		uint32_t idx_element = idx % elements_in_chunk;
		uint32_t validator = uint32_t(id >> 32);
		bool owned = (validator_chunks[idx_chunk][idx_element] & 0x7FFFFFFF) == validator;
		if (THREAD_SAFE) {
			spin_lock.unlock();
		}
		return owned;
	}
	_FORCE_INLINE_ void free(const RID &p_rid) {