device: disconnect signal handlers when modem object removed

Don't rely on the automatic disconnection of the signal as the last
reference of the modem object may outlive the device object.

Also, setup a common clear_modem() function to dispose the internal
reference of the modem object, which will take care of the signal
disconnection when required.

https://lists.freedesktop.org/archives/modemmanager-devel/2017-February/003907.html
1 file changed