USB MIDI: Use Thread.interrupt() to close threads

We start input threads before setting mIsOpen.
This means that sometimes, input threads immediately exit
due to a race condition.

The fix here is to remove the use of mIsOpen and use a new
mechanism with Thread.interrupt() and Thread.interrupted()
to mark a thread to be closed.

Bug: 223316278
Test: MidiScope/MidiKeyboard
Test: CTS Verifier Bluetooth Tests
Change-Id: I7c221504ae8a8814c1aa5598552494c80c202eb2
1 file changed