Added more assert() statements.

  Just for sanity.
  Avoid segfault in empty MIME-sections.

  I have a weird mail that has an empty text/plain segment.
 Not sure how valid it is, but this fixes it to not-crash
 anyway.