FIX: prevent an infinite loop when a garbled message is parsed

The only message in the incoming buffer which happens to be garbled
leads to the infinite loop

Reported-by: Pekka Enberg <penberg@iki.fi>
Signed-off-by: Marat Stanichenko <mstanichenko@gmail.com>
Signed-off-by: Pekka Enberg <penberg@iki.fi>