Process all messages before throwing EOF errors
Merge pull request #20 from tarruda/fix-next_message-error-handling

Process all messages before throwing EOF errors