bluez5: fix more crashes on missing adapter / quitting bluetoothd
I think this now catches all the cases (always check before spa_bt_device_add_profile
)...
bluez5: require adapter before profile connect & after
All exposed bluez devices should have an adapter specified at all times. Adapter-less devices appear in some race conditions in BlueZ interface.
Require device has non-null adapter, in all cases before adding any profiles (which exposes the device), and reject BlueZ profile connection attempts in that state.
If an adapter gets removed by BlueZ, remove also all its devices, so that device->adapter pointers stay valid.
bluez5: don't crash in battery_remove
If device has no adapter, then there's no battery provider.
bluez5: maintain transport->device_list properly
If device != NULL, the transport must be in its transport_list.