Fixed MessageIn::getUnreadLength

It should not return large numbers after reading past the end of a
message. This can cause infinite loops in several places in the client
when a message happened to be shorter than expected.