Fixed an issue with detecting when clients disconnected

When we switched to using bufio.Scanner, the way it handled the EOF
case was different than the older bufio.ReadLine

Fix comes complete with unit test coverage