Fix RangeSet cursor problem

When the last or first range in the set is removed then the cursor may end
up pointing back at the anchor point. This confused RangeSetPop() so we
need to make sure that the cursor wraps round when this happens, such that
the only valid reason for the cursor to ever point at the anchor is when
the set goes empty.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Add magic number and bounds checking...

... for event channel and grant table descriptors.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Merge pull request #23 from pauldu/ca-134511

CA-134511