It seems that adb lost connection to the device and cannot re-establish if the server is closed for whatever reason. You can reproduce it by
adb shell
adb kill-server
adb shell
We should, for start, be able to return here a clear error if we cannot execute commands for this reason.