Apply mask before checking string length to see if entire message is received

Resolves issue #16, where multi-byte encoded messages were sometimes reporting a length less than the length reported by the message's headers.  Applied to non-mbstring logic branch for consistency.