sercmd: refactored reading the rest from socket on reply too long

- patch by by Savolainen Dmitri, FS#422