Detect and close dead Bluetooth connections
Some devices fail to detect dead Bluetooth connections, even if the other side closes the connection cleanly; if a read is in progress it never returns. This branch adds keepalives and an InputStream wrapper that detects reads that have timed out.
Second part of #1712 (closed).