Cleanly remove the device FD from the event loop before closing it.