macOS Bluetooth: report RemoteHostClosed error when the RFCOMM channel is closed
The ChannelDelegate::channelClosed() virtual method is called in two
cases:
* when an attempt to open the channel failed (because of the timeout
or an error in rfcommChannelOpenComplete() callbalk).
* when the rfcommChannelClosed() callback is triggered. This happens
only when the remote host closes the connection.
In the first case we set UnknownSocketError. Keep this behavior.
In the second case no error was reported, which is different from how
other backends behave. This patch updates the code to set the
RemoteHostClosed error if the channelClosed() is called, and the
socket was in Connected state.
Task-number: QTBUG-123430
Pick-to: 6.8 6.7 6.5
Change-Id: Ie21a2e66b570a32b1c4401305738515bc6d04f85
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>