added error checking after session_loop

Plus dropped io.EOF equality checking since receive() never returns io.EOF. Also dropping of isConnReset and merging into one general if err != nil clause should probably be done, since the result in both cases is the same (break).

UPDATE
isConnReset(err) should be called alone and not in a boolean operation, my bad