reader thread will now do a inputStream.available instead of a .read to avoid blocking.
with this change the thread is not longer a deamon thread and should exit normally.