Ensure key agreement tasks finish if they ignore interrupts
The problem here was that BluetoothSocket#connect()
was throwing an IOException when the task was interrupted - the task treated this like any other connection failure and retried, so the task never finished.
The fix is to check whether the timeout has expired before retrying, so the task eventually finishes even if it ignores the original interrupt.
Closes #283 (closed)