Before this commit, the callback would delete itself from the list,
causing an exception:
File ".../glasgow/device/hardware.py", line 207, in close
self.usb_context.close()
File ".../python-libusb1/build/lib/usb1/__init__.py", line 2288, in close
self._exit()
File ".../python-libusb1/build/lib/usb1/__init__.py", line 2296, in _exit
for handle in self.__hotplug_callback_dict.keys():
RuntimeError: dictionary changed size during iteration
Before this commit, the callback would delete itself from the list, causing an exception: