keep a reference to the device for each active transfer and let the backend handle cancelling active transfers when a device is disconnected

This commit should fix issues with active transfers when a device is
disconnected. The backend is responsible for making sure the completion
callbacks are made, not the hotplug code. This should fix a number of
issues including duplicate callbacks and segmentation faults.

References #124.
3 files changed