CA-137990 & CA-140031: allow ring disconnection with pending requests

This patch allows disconnecting from the ring even though there are
pending requests. This allows the front-end to close and re-open then
ring when necessary (e.g. I/O is slow and the front-end is told to reset
itself) without having to wait for these requests to complete, as
cancelling requests is not supported by Xenbus.

Rings with pending requests aren't immediately destroyed (that's
impossible), but are marked as dead. Requests completing against dead
rings are cleaned up and the last pending requests truly destroys the
ring. There can be multiple dead rings. When closing the VBD we have to
wait for all pending requests against all dead rings to complete.

Finally, we maintain a list of active rings, as there can be multiple
rings against the same VBD (e.g. multiple VMs using the same ISO). It is
unknown how this worked so far.

Minor improvements are introduced.

Signed-off-by: Thanos Makatos <thanos.makatos@citrix.com>
Reviewed-by: Chandrika Srinivasan <chandrika.srinivasan@citrix.com>

GitHub: closes #114 on xapi-project/blktap