Handle cases where logstash dies while decoding email headers.

This caused the plugin to crash with the following error:

A plugin had an unrecoverable error. Will restart this plugin.
  Plugin: <LogStash::Inputs::IMAP host=>"foo.acme.com", user=>"johndoe", tags=>["imap"], content_type=>"text/plain">
  Error: undefined method `encode' for nil:NilClass {:level=>:error}