test: check write wraps around the ring properly

Note the subtlety surrounding 'read': it returns a reference to
the data in the ring and doesn't consume it until the next read.

Signed-off-by: David Scott <dave.scott@citrix.com>