QModbusDevice::disconnectDevice(): return early in ClosingState
As the comment mentions, the UnconnectedState can be set by the
backend implementation with a delay due to event loop handling.
That is, for example, the case for the TCP-based client.
In such cases, there is a possibility that disconnectDevice() will be
called for the second time while the device is still in a ClosingState.
We do not need to call the backend close() implementation again, and
can just return early in such cases.
If the device is already in a ClosingState, then there's no need to
call the backend close() implementation again.
Change-Id: I0bde71343c1febaa863aff48e98a00a324689b2d
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>