Switch back to master when disconnecting active remote.
Fixed up auto-reconnect time-interval computation.

Had been unwittingly not using the carefully-calculated left-shift
value, as revealed by clang/LLVM's scan-build static analyzer.
Ignore BadWindow errors from XSelectInput().

They can result from (as I understand it) a race between window
creation and destruction, and if we lose that race it doesn't really
matter anyway.