### 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)

static SafeNumeric<uint64_t> base_id;
protected:
	static RID _make_from_id(uint64_t p_id) {
		RID rid;
		rid._id = p_id;
		return rid;
	}
	static RID _gen_rid() {
		return _make_from_id(_gen_id());
	}
	friend struct VariantUtilityFunctions;
	static uint64_t _gen_id() {
		return base_id.increment();
	}
public:
	virtual ~RID_AllocBase() {}
};
template <class T, bool THREAD_SAFE = false>
class RID_Alloc : public RID_AllocBase {