Move ring layout validation to a function and adds checks for non-overlapping memory regions among the ring buffer control variables and 32-bit aligned offsets.
v2: add memory region overlap tests v3: check for 32-bit aligned offsets
/cc @olv @zzyiwei