Wait SCO socket to HUP before changing state
Wait SCO socket to HUP before changing state

In situations where application wants to switch profiles e.g HFP to A2DP
it normally needs to wait SCO to be disconnected to resume A2DP due to
resource limitations on headset.

There seems to be an issue in the kernel side which prevent this to work
properly, apparently shutdown does not wait the link to be disconnected,
but it is under investigation.

ComputeCycles/bluez,pkarasev3/bluez,pstglia/external-bluetooth-bluez,mapfau/bluez,pstglia/external-bluetooth-bluez,pkarasev3/bluez,pstglia/external-bluetooth-bluez,silent-snowman/bluez,mapfau/bluez,pkarasev3/bluez,mapfau/bluez,ComputeCycles/bluez,silent-snowman/bluez,ComputeCycles/bluez,pkarasev3/bluez,mapfau/bluez,silent-snowman/bluez,pstglia/external-bluetooth-bluez,ComputeCycles/bluez,silent-snowman/bluez