When the console/xenstore ring pointers overflow a 32-bit signed int, adjust the modulo arithmetic to match
In the xenstore and console rings, if we hit the highest byte, repeat the read/write call. This matches the behaviour of the old C code (although it shouldn't be required)
Add unit tests to check 32-bit int overflow handling